@protobase/ui 0.19.13 → 0.19.15
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/app/create/create-page.js +3 -3
- package/dist/app/create/create-values.js +8 -3
- package/dist/app/custom-section.js +1 -1
- package/dist/app/displays/list-cards.js +1 -1
- package/dist/app/displays/map-display.js +1 -1
- package/dist/app/displays/record-card.js +2 -2
- package/dist/app/displays/record-link.js +1 -1
- package/dist/app/embedded-list/embedded-list.js +1 -1
- package/dist/app/field-editor.js +6 -6
- package/dist/app/gallery/detail-fields.js +4 -3
- package/dist/app/gallery/gallery-section.js +1 -1
- package/dist/app/gallery/lightbox.js +1 -1
- package/dist/app/gallery/photo-details.js +3 -3
- package/dist/app/import/import-dialog.js +1 -1
- package/dist/app/list-page.js +3 -3
- package/dist/app/pages/action-inputs/action-inputs-dialog.d.ts +13 -0
- package/dist/app/pages/action-inputs/action-inputs-dialog.js +111 -0
- package/dist/app/pages/action-inputs/input-answers.js +88 -0
- package/dist/app/pages/action-inputs/input-errors.d.ts +11 -0
- package/dist/app/pages/action-inputs/input-errors.js +25 -0
- package/dist/app/pages/action-prompt.js +29 -0
- package/dist/app/pages/blocks/action.js +8 -4
- package/dist/app/pages/blocks/card-row.js +1 -1
- package/dist/app/pages/blocks/link.js +1 -1
- package/dist/app/pages/blocks/modal-form.js +5 -5
- package/dist/app/pages/blocks/record-card.js +1 -1
- package/dist/app/pages/blocks/stat.js +1 -1
- package/dist/app/pages/field-value.js +2 -2
- package/dist/app/pages/project-ui.d.ts +5 -0
- package/dist/app/pages/record-actions.js +8 -4
- package/dist/app/pages/use-run-action.js +17 -7
- package/dist/app/record-lines.js +1 -1
- package/dist/app/record-mode/record-mode.js +7 -1
- package/dist/app/record-page.js +13 -13
- package/dist/app/record-row/record-row-body.js +1 -1
- package/dist/app/record-row/saved-record-row.js +1 -1
- package/dist/app/related-section.js +1 -1
- package/dist/app/searches/saved-search-rows.js +1 -1
- package/dist/app/searches/saved-searches.js +2 -2
- package/dist/app/searches/search-controls.js +1 -1
- package/dist/app/searches/search-name-dialog.js +1 -1
- package/dist/app/searches/update-search-dialog.js +1 -1
- package/dist/app/searches/use-save-search.js +1 -1
- package/dist/app/sensitive-field.js +2 -2
- package/dist/app/use-record-editor.js +1 -1
- package/dist/auth/sign-in-prompt.js +1 -1
- package/dist/data-grid/cells.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -4
- package/dist/live/columns-from-model.js +1 -1
- package/dist/markdown/markdown-editor.js +1 -1
- package/dist/package.js +1 -1
- package/dist/shell/assets/app-WromtADN.js +69 -0
- package/dist/shell/assets/{index-ztKNmFFb.js → index-CzV9U_NJ.js} +1 -1
- package/dist/shell/assets/{maplibre-CsiuejGw.js → maplibre-G35v6TYU.js} +2 -2
- package/dist/shell/assets/{markdown-content-4BktGTHi.js → markdown-content-DGFnggSX.js} +1 -1
- package/dist/shell/assets/{record-map-De6U-Z0I.js → record-map-ZAC_U52Y.js} +1 -1
- package/dist/shell/assets/{records-map-DaIZwI2y.js → records-map-DLXOQVpM.js} +1 -1
- package/dist/shell/assets/shared-protobase-ui-xByMDSPg.js +1 -0
- package/dist/shell/index.html +3 -3
- package/dist/shell/protobase.shell.json +1 -1
- package/package.json +4 -4
- package/dist/shell/assets/app-D65L8GHE.js +0 -69
- package/dist/shell/assets/shared-protobase-ui-DdZuFJz6.js +0 -1
|
@@ -6,12 +6,12 @@ import { fileShown, shownImage } from "../../live/file-values.js";
|
|
|
6
6
|
import { displayValue } from "../../live/display-value.js";
|
|
7
7
|
import { AppLink } from "../use-app-address.js";
|
|
8
8
|
import { FileImage } from "../../live/file-image.js";
|
|
9
|
-
import { fetchLabels } from "../../live/relation-labels.js";
|
|
10
9
|
import { useShownWidget } from "../field-types/shown-widget.js";
|
|
11
10
|
import { WidgetPart } from "../field-types/widget-part.js";
|
|
11
|
+
import { Markdown } from "../../markdown/markdown.js";
|
|
12
12
|
import { isMarkdown } from "../../markdown/markdown-hint.js";
|
|
13
|
+
import { fetchLabels } from "../../live/relation-labels.js";
|
|
13
14
|
import { ValueBadge } from "../value-badge.js";
|
|
14
|
-
import { Markdown } from "../../markdown/markdown.js";
|
|
15
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
16
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
17
17
|
//#region src/app/pages/field-value.tsx
|
|
@@ -18,6 +18,11 @@ export type ActionContext = {
|
|
|
18
18
|
client: Client;
|
|
19
19
|
/** Moves the app to an address, such as `{ kind: 'record', resource: 'orders', key: 42 }`. */
|
|
20
20
|
navigate: (to: AppAddress) => void;
|
|
21
|
+
/**
|
|
22
|
+
* The answers to the action's inputs, by input name, for an action with `inputs`: those that show, null when left
|
|
23
|
+
* empty. Throwing `ActionInputError` refuses them, each message under its input.
|
|
24
|
+
*/
|
|
25
|
+
values?: Record<string, unknown>;
|
|
21
26
|
};
|
|
22
27
|
export type ActionHandler = (context: ActionContext) => void | Promise<void>;
|
|
23
28
|
/** What a plugin's `beforeSignIn` component gets from the app, drawn around the pages someone signed out sees. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActionRail } from "../../record-view/action-rail.js";
|
|
2
2
|
import { AppLink, useAppAddress } from "../use-app-address.js";
|
|
3
|
+
import { ActionPrompt, asksFirst } from "./action-prompt.js";
|
|
3
4
|
import { useActionRunner } from "./use-run-action.js";
|
|
4
|
-
import { ActionRail } from "../../record-view/action-rail.js";
|
|
5
5
|
import { actionIcon } from "../action-icon.js";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { Pencil, Trash2 } from "lucide-react";
|
|
@@ -32,7 +32,7 @@ const RecordActions = ({ model, stored, recordKey, edit, onDelete }) => {
|
|
|
32
32
|
blocked: runner.blocked(action),
|
|
33
33
|
running: runner.running === action.name,
|
|
34
34
|
...action.run?.kind === "delete" && { tone: "danger" },
|
|
35
|
-
onRun: () => action
|
|
35
|
+
onRun: () => asksFirst(action) ? setAsking(action) : void runner.run(action)
|
|
36
36
|
}));
|
|
37
37
|
const deletes = runner.actions.some((action) => action.run?.kind === "delete");
|
|
38
38
|
const actions = [
|
|
@@ -54,7 +54,7 @@ const RecordActions = ({ model, stored, recordKey, edit, onDelete }) => {
|
|
|
54
54
|
}] : []
|
|
55
55
|
];
|
|
56
56
|
if (actions.length === 0) return null;
|
|
57
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ActionRail, { actions }), asking && /* @__PURE__ */ jsx(
|
|
57
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ActionRail, { actions }), asking && /* @__PURE__ */ jsx(ActionPrompt, {
|
|
58
58
|
action: asking,
|
|
59
59
|
label: asking.label,
|
|
60
60
|
danger: asking.run?.kind === "delete",
|
|
@@ -62,6 +62,10 @@ const RecordActions = ({ model, stored, recordKey, edit, onDelete }) => {
|
|
|
62
62
|
onConfirm: () => {
|
|
63
63
|
setAsking(void 0);
|
|
64
64
|
runner.run(asking);
|
|
65
|
+
},
|
|
66
|
+
onSubmit: async (values) => {
|
|
67
|
+
await runner.submit(asking, values);
|
|
68
|
+
setAsking(void 0);
|
|
65
69
|
}
|
|
66
70
|
})] });
|
|
67
71
|
};
|
|
@@ -2,8 +2,8 @@ import { useClient, useResourceClient } from "../../data/api-provider.js";
|
|
|
2
2
|
import { useToast } from "../../toasts/toast-provider.js";
|
|
3
3
|
import { useProjectUi } from "./project-ui.js";
|
|
4
4
|
import { useAdminMeta, usePermissions } from "../meta-gate.js";
|
|
5
|
-
import { can } from "../permissions.js";
|
|
6
5
|
import { useAppAddress } from "../use-app-address.js";
|
|
6
|
+
import { can } from "../permissions.js";
|
|
7
7
|
import { actionFor, linkTarget, openLink } from "./action-href.js";
|
|
8
8
|
import { useRefreshResource } from "./use-layout-data.js";
|
|
9
9
|
import { useState } from "react";
|
|
@@ -14,11 +14,11 @@ const message = (error) => error instanceof Error ? error.message : "Something w
|
|
|
14
14
|
* The named actions of `resource`'s view, ready to run on `scope` (the record they act on): built-in behaviour first
|
|
15
15
|
* (`update`, `delete`, `link`), else the handler the project registered under the action's name. A link to a URL the
|
|
16
16
|
* record holds is left out while it holds none. `blocked` says why one cannot run; `afterRun` hears about every action
|
|
17
|
-
* that succeeded.
|
|
17
|
+
* that succeeded. `submit` runs one with the answers to its inputs and throws its failure, for the dialog to show.
|
|
18
18
|
*/
|
|
19
19
|
const useActionRunner = (resource, scope, afterRun) => {
|
|
20
20
|
const { views } = useAdminMeta();
|
|
21
|
-
const { actions: handlers } = useProjectUi();
|
|
21
|
+
const { actions: handlers, components } = useProjectUi();
|
|
22
22
|
const permissions = usePermissions(resource);
|
|
23
23
|
const client = useClient();
|
|
24
24
|
const handlerClient = useResourceClient(resource);
|
|
@@ -33,8 +33,10 @@ const useActionRunner = (resource, scope, afterRun) => {
|
|
|
33
33
|
if (kind === "update" && (!can(permissions, "update") || scope?.permissions?.update === false)) return "You cannot change this record";
|
|
34
34
|
if (kind === "delete" && (!can(permissions, "delete") || scope?.permissions?.delete === false)) return "You cannot delete this record";
|
|
35
35
|
if (!action.run && !handlers?.[action.name]) return `The app has no handler for "${action.name}"`;
|
|
36
|
+
const custom = action.inputs?.find((input) => input.kind === "custom" && !components?.[input.component ?? ""]);
|
|
37
|
+
if (custom) return `The app has no component "${custom.component}" for input "${custom.name}"`;
|
|
36
38
|
};
|
|
37
|
-
const perform = async (action) => {
|
|
39
|
+
const perform = async (action, values) => {
|
|
38
40
|
const { run } = action;
|
|
39
41
|
if (run?.kind === "link") {
|
|
40
42
|
if ("to" in run) go(fillAddress(run.to, scope?.record));
|
|
@@ -49,7 +51,8 @@ const useActionRunner = (resource, scope, afterRun) => {
|
|
|
49
51
|
recordKey: scope?.key,
|
|
50
52
|
etag: scope?.etag,
|
|
51
53
|
client: handlerClient,
|
|
52
|
-
navigate: go
|
|
54
|
+
navigate: go,
|
|
55
|
+
...values && { values }
|
|
53
56
|
});
|
|
54
57
|
await refresh(resource);
|
|
55
58
|
toast.show({
|
|
@@ -68,11 +71,17 @@ const useActionRunner = (resource, scope, afterRun) => {
|
|
|
68
71
|
}));
|
|
69
72
|
setRunning(void 0);
|
|
70
73
|
};
|
|
74
|
+
const submit = async (action, values) => {
|
|
75
|
+
if (blocked(action)) return;
|
|
76
|
+
setRunning(action.name);
|
|
77
|
+
await perform(action, values).finally(() => setRunning(void 0));
|
|
78
|
+
};
|
|
71
79
|
return {
|
|
72
80
|
actions,
|
|
73
81
|
blocked,
|
|
74
82
|
running,
|
|
75
|
-
run
|
|
83
|
+
run,
|
|
84
|
+
submit
|
|
76
85
|
};
|
|
77
86
|
};
|
|
78
87
|
/** One named action of `resource`'s view, for a button. */
|
|
@@ -83,7 +92,8 @@ const useRunAction = (resource, name, scope) => {
|
|
|
83
92
|
action,
|
|
84
93
|
blocked: action ? runner.blocked(action) : `No action "${name}"`,
|
|
85
94
|
running: runner.running === name,
|
|
86
|
-
run: () => action ? runner.run(action) : Promise.resolve()
|
|
95
|
+
run: () => action ? runner.run(action) : Promise.resolve(),
|
|
96
|
+
submit: (values) => action ? runner.submit(action, values) : Promise.resolve()
|
|
87
97
|
};
|
|
88
98
|
};
|
|
89
99
|
//#endregion
|
package/dist/app/record-lines.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { usePermissions } from "./meta-gate.js";
|
|
2
|
-
import { can } from "./permissions.js";
|
|
3
2
|
import { InlineChildTable } from "../inline-child-table/inline-child-table.js";
|
|
4
3
|
import { Section } from "../record-view/section.js";
|
|
4
|
+
import { can } from "./permissions.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/app/record-lines.tsx
|
|
7
7
|
/** A resource that holds numbered lines of this one: it points at the parent and has `position` and `quantity`. */
|
|
@@ -32,5 +32,11 @@ const recordShown = (mode, canUpdate, edit) => {
|
|
|
32
32
|
const helpShown = (own, view, editing) => (own ?? view?.helpWhen ?? "always") === "always" || editing;
|
|
33
33
|
/** A field's help line on the record page, when it shows. */
|
|
34
34
|
const fieldHelp = (hints, view, editing) => hints?.help !== void 0 && helpShown(hints.helpWhen, view, editing) ? hints.help : void 0;
|
|
35
|
+
/** Whether a field or layout item shows: always, unless it says only while editing or only while reading and the page is not. */
|
|
36
|
+
const whenShown = (when, editing) => {
|
|
37
|
+
if (when === "editing") return editing;
|
|
38
|
+
if (when === "reading") return !editing;
|
|
39
|
+
return true;
|
|
40
|
+
};
|
|
35
41
|
//#endregion
|
|
36
|
-
export { fieldHelp, helpShown, recordShown };
|
|
42
|
+
export { fieldHelp, helpShown, recordShown, whenShown };
|
package/dist/app/record-page.js
CHANGED
|
@@ -10,25 +10,26 @@ import { recordTitle } from "../live/model-helpers.js";
|
|
|
10
10
|
import { humanize } from "../live/naming.js";
|
|
11
11
|
import { useProjectUi } from "./pages/project-ui.js";
|
|
12
12
|
import { Notice, useAdminMeta, usePermissions } from "./meta-gate.js";
|
|
13
|
-
import {
|
|
13
|
+
import { Field } from "../record-view/field.js";
|
|
14
|
+
import { Section } from "../record-view/section.js";
|
|
15
|
+
import { MetadataCard, RelatedRecords, SidebarCard } from "../record-view/record-sidebar.js";
|
|
16
|
+
import { RecordHeader } from "../record-view/record-header.js";
|
|
17
|
+
import { SpecTable } from "../record-view/spec-table.js";
|
|
18
|
+
import { KeyFacts } from "../record-view/key-facts.js";
|
|
19
|
+
import { fieldHelp, helpShown, recordShown, whenShown } from "./record-mode/record-mode.js";
|
|
20
|
+
import { ErrorBanner } from "./error-banner.js";
|
|
14
21
|
import { displayValue } from "../live/display-value.js";
|
|
15
22
|
import { filledFields } from "./filled-fields.js";
|
|
16
23
|
import { AppLink, useAppAddress } from "./use-app-address.js";
|
|
17
|
-
import { ErrorBanner } from "./error-banner.js";
|
|
18
24
|
import { shownWidget } from "./field-types/shown-widget.js";
|
|
19
25
|
import { WidgetPart } from "./field-types/widget-part.js";
|
|
26
|
+
import { Markdown } from "../markdown/markdown.js";
|
|
20
27
|
import { isMarkdown } from "../markdown/markdown-hint.js";
|
|
28
|
+
import { FieldEditor } from "./field-editor.js";
|
|
29
|
+
import { can, fieldAccess } from "./permissions.js";
|
|
21
30
|
import { toneFor } from "../live/columns-from-model.js";
|
|
22
31
|
import { ValueBadge } from "./value-badge.js";
|
|
23
|
-
import { Markdown } from "../markdown/markdown.js";
|
|
24
32
|
import { FieldValue } from "./pages/field-value.js";
|
|
25
|
-
import { Field } from "../record-view/field.js";
|
|
26
|
-
import { Section } from "../record-view/section.js";
|
|
27
|
-
import { MetadataCard, RelatedRecords, SidebarCard } from "../record-view/record-sidebar.js";
|
|
28
|
-
import { RecordHeader } from "../record-view/record-header.js";
|
|
29
|
-
import { SpecTable } from "../record-view/spec-table.js";
|
|
30
|
-
import { KeyFacts } from "../record-view/key-facts.js";
|
|
31
|
-
import { FieldEditor } from "./field-editor.js";
|
|
32
33
|
import { namedIcon } from "./named-icon.js";
|
|
33
34
|
import { useDeleteFlow } from "./delete/use-delete-flow.js";
|
|
34
35
|
import { useRestore } from "./delete/use-restore.js";
|
|
@@ -41,7 +42,6 @@ import { draftStorageKey } from "./draft-storage.js";
|
|
|
41
42
|
import { useLines } from "./use-lines.js";
|
|
42
43
|
import { useLinesDraft } from "./use-lines-draft.js";
|
|
43
44
|
import { GallerySection } from "./gallery/gallery-section.js";
|
|
44
|
-
import { fieldHelp, helpShown, recordShown } from "./record-mode/record-mode.js";
|
|
45
45
|
import { useRecordEditor } from "./use-record-editor.js";
|
|
46
46
|
import { useRelatedRecords } from "./use-related-records.js";
|
|
47
47
|
import { RelatedSection } from "./related-section.js";
|
|
@@ -148,14 +148,14 @@ const LoadedRecord = ({ model, recordKey, stored }) => {
|
|
|
148
148
|
});
|
|
149
149
|
const related = useRelatedRecords(model, view, meta.resources, meta.views, stored.record, basePath);
|
|
150
150
|
const { fields: fieldTypes } = useProjectUi();
|
|
151
|
-
const layout = layoutFor(model, view, shown === "read");
|
|
151
|
+
const layout = layoutFor(model, view, shown === "read").filter((item) => whenShown(item.when, editing));
|
|
152
152
|
const sidebarFields = layout.flatMap((item) => item.kind === "sidebar" ? item.fields : []);
|
|
153
153
|
const hasStatus = model.fields.status?.type === "enum";
|
|
154
154
|
const statusValue = stored.record.status;
|
|
155
155
|
const status = hasStatus && !sidebarFields.includes("status") && statusValue !== null && statusValue !== void 0 && statusValue !== "" ? String(statusValue) : void 0;
|
|
156
156
|
const updatedAt = auditField(model, "updated");
|
|
157
157
|
const hint = (name) => view?.fields[name];
|
|
158
|
-
const visible = (name) => fieldAccess(stored.permissions, name) !== "hidden";
|
|
158
|
+
const visible = (name) => fieldAccess(stored.permissions, name) !== "hidden" && whenShown(hint(name)?.when, editing);
|
|
159
159
|
const fieldView = (name) => {
|
|
160
160
|
const field = model.fields[name];
|
|
161
161
|
const access = fieldAccess(stored.permissions, name);
|
|
@@ -2,10 +2,10 @@ import { useIsXs } from "../../lib/use-media-query.js";
|
|
|
2
2
|
import { Skeleton } from "../../primitives/skeleton.js";
|
|
3
3
|
import { humanize } from "../../live/naming.js";
|
|
4
4
|
import { useAdminMeta } from "../meta-gate.js";
|
|
5
|
+
import { ErrorBanner } from "../error-banner.js";
|
|
5
6
|
import { displaysOf, loadedFields } from "../displays/list-displays.js";
|
|
6
7
|
import { defaultOrderBy } from "../list-order.js";
|
|
7
8
|
import { AppLink } from "../use-app-address.js";
|
|
8
|
-
import { ErrorBanner } from "../error-banner.js";
|
|
9
9
|
import { useLiveRows } from "../../live/use-live-rows.js";
|
|
10
10
|
import { viewAllAddress } from "../embedded-list/embedded-display.js";
|
|
11
11
|
import { FilterChipList } from "../searches/filter-chip-list.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Skeleton } from "../../primitives/skeleton.js";
|
|
2
2
|
import { humanize } from "../../live/naming.js";
|
|
3
3
|
import { useAdminMeta } from "../meta-gate.js";
|
|
4
|
-
import { listedResource } from "../current-address.js";
|
|
5
4
|
import { ErrorBanner } from "../error-banner.js";
|
|
5
|
+
import { listedResource } from "../current-address.js";
|
|
6
6
|
import { savedScope } from "../saved/saved-records.js";
|
|
7
7
|
import { useSavedRecords } from "../saved/use-saved-records.js";
|
|
8
8
|
import { RecordRowBody } from "./record-row-body.js";
|
|
@@ -2,9 +2,9 @@ import { Skeleton } from "../primitives/skeleton.js";
|
|
|
2
2
|
import { keys } from "../data/query-keys.js";
|
|
3
3
|
import { useClient } from "../data/api-provider.js";
|
|
4
4
|
import { useAdminMeta } from "./meta-gate.js";
|
|
5
|
+
import { Section } from "../record-view/section.js";
|
|
5
6
|
import { ErrorBanner } from "./error-banner.js";
|
|
6
7
|
import { listColumnNames } from "../live/columns-from-model.js";
|
|
7
|
-
import { Section } from "../record-view/section.js";
|
|
8
8
|
import { EmbeddedDisplaySwitch, EmbeddedList } from "./embedded-list/embedded-list.js";
|
|
9
9
|
import { useEmbeddedDisplay } from "./embedded-list/use-embedded-display.js";
|
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -2,8 +2,8 @@ import { Skeleton } from "../../primitives/skeleton.js";
|
|
|
2
2
|
import { recordKey } from "../../live/model-helpers.js";
|
|
3
3
|
import { humanize } from "../../live/naming.js";
|
|
4
4
|
import { useAdminMeta } from "../meta-gate.js";
|
|
5
|
-
import { AppLink } from "../use-app-address.js";
|
|
6
5
|
import { ErrorBanner } from "../error-banner.js";
|
|
6
|
+
import { AppLink } from "../use-app-address.js";
|
|
7
7
|
import { InlineFilterChips } from "./filter-chip-list.js";
|
|
8
8
|
import { RecordRowBody } from "../record-row/record-row-body.js";
|
|
9
9
|
import { useSavedSearches } from "./use-saved-searches.js";
|
|
@@ -3,9 +3,9 @@ import { PageHeader } from "../../app-shell/page-header.js";
|
|
|
3
3
|
import { recordKey } from "../../live/model-helpers.js";
|
|
4
4
|
import { humanize } from "../../live/naming.js";
|
|
5
5
|
import { Notice, useAdminMeta, usePermissions } from "../meta-gate.js";
|
|
6
|
-
import { can } from "../permissions.js";
|
|
7
|
-
import { AppLink } from "../use-app-address.js";
|
|
8
6
|
import { ErrorBanner } from "../error-banner.js";
|
|
7
|
+
import { AppLink } from "../use-app-address.js";
|
|
8
|
+
import { can } from "../permissions.js";
|
|
9
9
|
import { useSavedSearches } from "./use-saved-searches.js";
|
|
10
10
|
import { useDeleteFlow } from "../delete/use-delete-flow.js";
|
|
11
11
|
import { SavedSearchSection } from "./saved-search-section.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useClient } from "../../data/api-provider.js";
|
|
2
2
|
import { humanize } from "../../live/naming.js";
|
|
3
3
|
import { useToast } from "../../toasts/toast-provider.js";
|
|
4
|
-
import { useRefreshResource } from "../pages/use-layout-data.js";
|
|
5
4
|
import { Switch } from "../../primitives/switch.js";
|
|
5
|
+
import { useRefreshResource } from "../pages/use-layout-data.js";
|
|
6
6
|
import { useId } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { useMutation } from "@tanstack/react-query";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Input } from "../../primitives/input.js";
|
|
2
2
|
import { Button } from "../../primitives/button.js";
|
|
3
|
-
import { FilterChipList } from "./filter-chip-list.js";
|
|
4
3
|
import { ResponsiveDialog } from "../../primitives/responsive-dialog.js";
|
|
4
|
+
import { FilterChipList } from "./filter-chip-list.js";
|
|
5
5
|
import { useId, useState } from "react";
|
|
6
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
//#region src/app/searches/search-name-dialog.tsx
|
|
@@ -2,10 +2,10 @@ import { Skeleton } from "../../primitives/skeleton.js";
|
|
|
2
2
|
import { Button } from "../../primitives/button.js";
|
|
3
3
|
import { useClient } from "../../data/api-provider.js";
|
|
4
4
|
import { humanize } from "../../live/naming.js";
|
|
5
|
+
import { ResponsiveDialog } from "../../primitives/responsive-dialog.js";
|
|
5
6
|
import { defaultOrderBy } from "../list-order.js";
|
|
6
7
|
import { countQuery } from "../pages/use-layout-data.js";
|
|
7
8
|
import { useFilterChips } from "./use-filter-chips.js";
|
|
8
|
-
import { ResponsiveDialog } from "../../primitives/responsive-dialog.js";
|
|
9
9
|
import { EmbeddedList } from "../embedded-list/embedded-list.js";
|
|
10
10
|
import { addedFilter, filterChanges, netChange, removedFilter } from "./search-diff.js";
|
|
11
11
|
import { useMemo } from "react";
|
|
@@ -3,8 +3,8 @@ import { recordKey } from "../../live/model-helpers.js";
|
|
|
3
3
|
import { humanize } from "../../live/naming.js";
|
|
4
4
|
import { useToast } from "../../toasts/toast-provider.js";
|
|
5
5
|
import { useAdminMeta } from "../meta-gate.js";
|
|
6
|
-
import { can } from "../permissions.js";
|
|
7
6
|
import { useAppAddress } from "../use-app-address.js";
|
|
7
|
+
import { can } from "../permissions.js";
|
|
8
8
|
import { useRefreshResource } from "../pages/use-layout-data.js";
|
|
9
9
|
import { useSavedSearches } from "./use-saved-searches.js";
|
|
10
10
|
import { useOpenedSearch } from "./use-opened-search.js";
|
|
@@ -2,9 +2,9 @@ import { cn } from "../lib/cn.js";
|
|
|
2
2
|
import { Input } from "../primitives/input.js";
|
|
3
3
|
import { Button } from "../primitives/button.js";
|
|
4
4
|
import { humanize } from "../live/naming.js";
|
|
5
|
-
import { displayValue } from "../live/display-value.js";
|
|
6
|
-
import { ErrorBanner } from "./error-banner.js";
|
|
7
5
|
import { toDraft } from "../live/field-values.js";
|
|
6
|
+
import { ErrorBanner } from "./error-banner.js";
|
|
7
|
+
import { displayValue } from "../live/display-value.js";
|
|
8
8
|
import { useState } from "react";
|
|
9
9
|
import { Eye, EyeOff } from "lucide-react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { keys } from "../data/query-keys.js";
|
|
2
2
|
import { useClient } from "../data/api-provider.js";
|
|
3
|
-
import { displayValue } from "../live/display-value.js";
|
|
4
3
|
import { differs, toDraft, toPatchValue } from "../live/field-values.js";
|
|
4
|
+
import { displayValue } from "../live/display-value.js";
|
|
5
5
|
import { useLiveSave } from "./use-live-save.js";
|
|
6
6
|
import { readDraft, writeDraft } from "./draft-storage.js";
|
|
7
7
|
import { isConflict, useUpdateRecord } from "../data/use-update-record.js";
|
|
@@ -2,8 +2,8 @@ import { RouteLink } from "../primitives/route-link.js";
|
|
|
2
2
|
import { useAuth } from "./auth-provider.js";
|
|
3
3
|
import { Button, buttonClass } from "../primitives/button.js";
|
|
4
4
|
import { useSignInAddress } from "./use-sign-in-address.js";
|
|
5
|
-
import { namedIcon } from "../app/named-icon.js";
|
|
6
5
|
import { ResponsiveDialog } from "../primitives/responsive-dialog.js";
|
|
6
|
+
import { namedIcon } from "../app/named-icon.js";
|
|
7
7
|
import { useId } from "react";
|
|
8
8
|
import { Check, LogIn } from "lucide-react";
|
|
9
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
package/dist/data-grid/cells.js
CHANGED
|
@@ -4,10 +4,10 @@ import { Badge } from "../primitives/badge.js";
|
|
|
4
4
|
import { formatMoney } from "../format/money.js";
|
|
5
5
|
import { formatInt, formatPercent, formatSigned } from "../format/number.js";
|
|
6
6
|
import { formatDate, formatDateTime } from "../format/date.js";
|
|
7
|
+
import { userById } from "../mocks/users.js";
|
|
7
8
|
import { fileShown, shownImage } from "../live/file-values.js";
|
|
8
9
|
import { FileImage } from "../live/file-image.js";
|
|
9
10
|
import { valueColor } from "../live/value-color.js";
|
|
10
|
-
import { userById } from "../mocks/users.js";
|
|
11
11
|
import { Check, Paperclip } from "lucide-react";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { enumLabel } from "@protobase/schema";
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ import { useList } from "./data/use-list.js";
|
|
|
11
11
|
import { useRecord } from "./data/use-record.js";
|
|
12
12
|
import { useFacets, useHistogram, useSeries } from "./data/use-aggregates.js";
|
|
13
13
|
import { isConflict, useUpdateRecord } from "./data/use-update-record.js";
|
|
14
|
+
import { ActionInputError } from "./app/pages/action-inputs/input-errors.js";
|
|
15
|
+
import { ActionInputProps } from "./app/pages/action-inputs/action-inputs-dialog.js";
|
|
14
16
|
import { pluginApi, protobaseVersion } from "./plugins/plugin-api.js";
|
|
15
17
|
import { mergeUi } from "./app/pages/merge-ui.js";
|
|
16
18
|
import { uiFromModule } from "./app/pages/ui-from-module.js";
|
|
@@ -57,4 +59,4 @@ import { Field, FieldProps } from "./record-view/field.js";
|
|
|
57
59
|
import { Section } from "./record-view/section.js";
|
|
58
60
|
import { Form, FormProps } from "./app/create/form.js";
|
|
59
61
|
import { Spinner } from "./primitives/spinner.js";
|
|
60
|
-
export { ActionCard, type ActionCardProps, type ActionContext, type ActionHandler, ApiProvider, type ApiProviderProps, App, AppLink, type AppProps, AssistantDock, type AssistantDockProps, AuthLayout, type AuthLayoutProps, type BackendData, type BackendRefresh, type BeforeSignInProps, Button, type ButtonProps, type CardAction, type CardTone, ChatMessage, 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, 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, MenuSelect, type MenuSelectProps, type MetaData, OtpInput, type OtpInputProps, PartView, type PluginInfo, type ProjectUi, type RecordCardProps, RecordLink, 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, buttonClass, definePlugin, defineUi, diffStats, isConflict, mergeUi, parseDiff, pluginApi, protobaseVersion, uiFromModule, useApiToken, useAppAddress, useAssistant, useAssistantClient, useBackendData, useClient, useFacets, useHistogram, useLayoutRecord, useList, useListDisplay, useMeta, usePlugin, useRecord, useResourceClient, useSeries, useUpdateRecord };
|
|
62
|
+
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, Button, type ButtonProps, type CardAction, type CardTone, ChatMessage, 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, 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, MenuSelect, type MenuSelectProps, type MetaData, OtpInput, type OtpInputProps, PartView, type PluginInfo, type ProjectUi, type RecordCardProps, RecordLink, 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, buttonClass, definePlugin, defineUi, diffStats, isConflict, mergeUi, parseDiff, pluginApi, protobaseVersion, uiFromModule, useApiToken, useAppAddress, useAssistant, useAssistantClient, useBackendData, useClient, useFacets, useHistogram, useLayoutRecord, useList, useListDisplay, useMeta, usePlugin, useRecord, useResourceClient, useSeries, useUpdateRecord };
|
package/dist/index.js
CHANGED
|
@@ -32,12 +32,13 @@ import { AssistantDock } from "./assistant-dock/assistant-dock.js";
|
|
|
32
32
|
import { useAssistant } from "./assistant-dock/use-assistant.js";
|
|
33
33
|
import { useAssistantClient } from "./assistant-dock/use-assistant-client.js";
|
|
34
34
|
import { useMeta } from "./data/use-meta.js";
|
|
35
|
-
import {
|
|
36
|
-
import { AppLink, useAppAddress } from "./app/use-app-address.js";
|
|
35
|
+
import { ResponsiveDialog } from "./primitives/responsive-dialog.js";
|
|
37
36
|
import { Field } from "./record-view/field.js";
|
|
38
37
|
import { Section } from "./record-view/section.js";
|
|
39
38
|
import { Textarea } from "./primitives/textarea.js";
|
|
40
|
-
import {
|
|
39
|
+
import { AppLink, useAppAddress } from "./app/use-app-address.js";
|
|
40
|
+
import { ActionInputError } from "./app/pages/action-inputs/input-errors.js";
|
|
41
|
+
import { useLayoutRecord } from "./app/pages/record-scope.js";
|
|
41
42
|
import { SignInPrompt } from "./auth/sign-in-prompt.js";
|
|
42
43
|
import { useListDisplay } from "./app/displays/display-context.js";
|
|
43
44
|
import { MenuSelect } from "./primitives/menu-select.js";
|
|
@@ -48,4 +49,4 @@ import { isConflict, useUpdateRecord } from "./data/use-update-record.js";
|
|
|
48
49
|
import { App } from "./app/app.js";
|
|
49
50
|
import { RecordLink } from "./app/displays/record-link.js";
|
|
50
51
|
import { Choices } from "./primitives/choices.js";
|
|
51
|
-
export { ActionCard, ApiProvider, App, AppLink, AssistantDock, AuthLayout, Button, ChatMessage, ChatThread, Choices, CodeForm, CompactTable, Composer, Dialog, DiffView, Field, FieldList, Form, Input, LogoMark, MenuSelect, OtpInput, PartView, RecordLink, ResendCodeButton, ResponsiveDialog, Section, Segmented, SidePanel, SignInPrompt, Spinner, StepList, Textarea, buttonClass, definePlugin, defineUi, diffStats, isConflict, mergeUi, parseDiff, pluginApi, protobaseVersion, uiFromModule, useApiToken, useAppAddress, useAssistant, useAssistantClient, useBackendData, useClient, useFacets, useHistogram, useLayoutRecord, useList, useListDisplay, useMeta, usePlugin, useRecord, useResourceClient, useSeries, useUpdateRecord };
|
|
52
|
+
export { ActionCard, ActionInputError, ApiProvider, App, AppLink, AssistantDock, AuthLayout, Button, ChatMessage, ChatThread, Choices, CodeForm, CompactTable, Composer, Dialog, DiffView, Field, FieldList, Form, Input, LogoMark, MenuSelect, OtpInput, PartView, RecordLink, ResendCodeButton, ResponsiveDialog, Section, Segmented, SidePanel, SignInPrompt, Spinner, StepList, Textarea, buttonClass, definePlugin, defineUi, diffStats, isConflict, mergeUi, parseDiff, pluginApi, protobaseVersion, uiFromModule, useApiToken, useAppAddress, useAssistant, useAssistantClient, useBackendData, useClient, useFacets, useHistogram, useLayoutRecord, useList, useListDisplay, useMeta, usePlugin, useRecord, useResourceClient, useSeries, useUpdateRecord };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { humanize } from "./naming.js";
|
|
2
|
-
import { markdownExcerpt } from "../markdown/markdown-excerpt.js";
|
|
3
2
|
import { isMarkdown } from "../markdown/markdown-hint.js";
|
|
3
|
+
import { markdownExcerpt } from "../markdown/markdown-excerpt.js";
|
|
4
4
|
import { enumLabel } from "@protobase/schema";
|
|
5
5
|
//#region src/live/columns-from-model.ts
|
|
6
6
|
const tones = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Segmented } from "../primitives/segmented.js";
|
|
2
|
-
import { Markdown } from "./markdown.js";
|
|
3
2
|
import { Textarea } from "../primitives/textarea.js";
|
|
3
|
+
import { Markdown } from "./markdown.js";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/markdown/markdown-editor.tsx
|
package/dist/package.js
CHANGED