@protobase/schema 0.12.17 → 0.12.19
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/index.d.ts +2 -2
- package/dist/layout.d.ts +11 -0
- package/dist/layout.js +13 -0
- package/dist/model.d.ts +14 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionModel, ActionRun, AppAddress, BadgeShape, BottomBarItemModel, BottomBarModel, CardPhotosModel, ChartGranularity, ChartModel, ChartRange, CheckedFilter, CompareOp, CustomSectionModel, DatePreset, DurationLiteral, DurationUnit, EventModel, EventOperation, FieldFormat, FieldModel, FieldPath, FieldType, FieldViewModel, FieldWidgetModel, FileFieldModel, FilterError, FilterErrorCode, FilterExpr, FilterLayout, FilterOf, FilterValue, FilterWidgetModel, JsonValue, KeyValue, LayoutItemModel, ListDisplayModel, ListModel, ListQuery, Literal, NavModel, NavRecentModel, NowValue, OrderByItem, RelatedModel, ResourceModel, SaveFeedback, SearchMatch, SearchResultModel, SortSpec, Span, StatusTone, UserMenuItemModel, UserMenuModel, ViewModel } from "./model.js";
|
|
1
|
+
import { ActionModel, ActionRun, AppAddress, BadgeShape, BottomBarItemModel, BottomBarModel, CardPhotosModel, ChartGranularity, ChartModel, ChartRange, CheckedFilter, CompareOp, CustomSectionModel, DatePreset, DurationLiteral, DurationUnit, EventModel, EventOperation, FieldFormat, FieldModel, FieldPath, FieldType, FieldViewModel, FieldWidgetModel, FileFieldModel, FilterError, FilterErrorCode, FilterExpr, FilterLayout, FilterOf, FilterValue, FilterWidgetModel, JsonValue, KeyValue, LayoutItemModel, ListDisplayModel, ListModel, ListQuery, Literal, MapSectionModel, NavModel, NavRecentModel, NowValue, OrderByItem, RelatedModel, ResourceModel, SaveFeedback, SearchMatch, SearchResultModel, SortSpec, Span, StatusTone, UserMenuItemModel, UserMenuModel, ViewModel } from "./model.js";
|
|
2
2
|
import { AccessAction, AccessContext, AccessFn, AccessResult, AccessUser, FieldAccess, FieldRule } from "./access/types.js";
|
|
3
3
|
import { FileProcessor, FileProcessorInput, checkedAccept, checkedProvider, parseSize } from "./files/file-options.js";
|
|
4
4
|
import { Field } from "./field.js";
|
|
@@ -44,4 +44,4 @@ import "./access/index.js";
|
|
|
44
44
|
import { AssistantAction, AssistantActionRequest, AssistantCardPart, AssistantDiff, AssistantEvent, AssistantMessage, AssistantMessageRequest, AssistantPart, AssistantState, AssistantStep, AssistantStepState, AssistantTablePart, AssistantTextPart, AssistantTone, AssistantWidgetPart } from "./assistant/protocol.js";
|
|
45
45
|
import { applyAssistantEvent, emptyAssistantState } from "./assistant/apply-event.js";
|
|
46
46
|
import { readEventStream } from "./assistant/event-stream.js";
|
|
47
|
-
export { type AccessAction, type AccessContext, type AccessFn, type AccessResult, type AccessSource, type AccessUser, type ActionModel, type ActionRun, type AddressCheck, type AppAddress, type AssistantAction, type AssistantActionRequest, type AssistantCardPart, type AssistantDiff, type AssistantEvent, type AssistantMessage, type AssistantMessageRequest, type AssistantPart, type AssistantState, type AssistantStep, type AssistantStepState, type AssistantTablePart, type AssistantTextPart, type AssistantTone, type AssistantWidgetPart, type BadgeShape, type BottomBarItemModel, type BottomBarModel, type BottomBarNames, type BottomBarSource, type Capability, type CapabilityAction, type CapabilityLimit, type CapabilityScope, type CardPhotosModel, type ChartGranularity, type ChartModel, type ChartRange, type CheckResult, type CheckedFilter, type CompareOp, type ComponentRef, type CustomSectionModel, type DatePreset, type DurationLiteral, type DurationUnit, type EvaluateOptions, type EventActor, type EventContext, type EventHelpers, type EventMatch, type EventModel, type EventOperation, type EventSpec, type Field, type FieldAccess, type FieldFormat, type FieldModel, type FieldPath, type FieldRefValue, type FieldRule, type FieldType, type FieldViewModel, type FieldWidgetModel, type FileField, type FileFieldModel, type FileProcessor, type FileProcessorInput, type FilterError, type FilterErrorCode, type FilterExpr, type FilterLayout, type FilterLimits, type FilterOf, type FilterParse, type FilterValue, type FilterWidgetModel, type InferRecord, type JsonValue, type KeyType, type KeyValue, type LayoutItemModel, type ListDisplayModel, type ListModel, type ListQuery, type Literal, type NavModel, type NavRecentModel, type NowValue, type OrderByCheck, type OrderByItem, type OrderByParse, type PluginHost, type PluginRequirement, type PropShapes, type RecordKey, type RefShape, type RelatedModel, type ResolveOptions, type ResolvedAccess, type ResourceModel, type RoleEntry, type RoleLimit, type Roles, type RolesOptions, type RowFilterOperation, type Rule, type SaveFeedback, type SearchMatch, type SearchResultModel, type SearchTerm, type SortSpec, type Span, type StatusTone, type UserMenuItemModel, type UserMenuModel, type UserMenuSource, type ViewModel, type ViewProps, accessWarnings, addressErrors, addressPlaceholders, addressWords, anonymousRole, appHrefError, appPath, applyAssistantEvent, bottomBar, bottomBarErrors, bottomBarFor, checkEventFilter, checkFilter, checkOrderBy, checkRecord, checkedAccept, checkedProvider, createWhere, decodeKey, defaultRecentLimit, defineRoles, displayFields, emptyAssistantState, encodeKey, enumLabel, evaluateFilter, f, fieldRef, fieldRefsIn, fieldsUsedBy, fillAddress, hrefPlaceholders, inRange, isFieldRef, keyTypes, layout as l, leavesApp, markFieldRefs, matchedSearchField, matchesSearch, maxBottomBarItems, navRecentErrors, parseFilter, parseOrderBy, parseSize, pickView, pluginProblem, printFilter, printOrderBy, pruneByShape, readAppPath, readEventStream, redactSecrets, resolveAccess, resource, restrictModel, rule, searchTerms, shapes, statusTones, tableDisplay, termMatches, unmarkFieldRefs, userMenu, view, webhookResources, where };
|
|
47
|
+
export { type AccessAction, type AccessContext, type AccessFn, type AccessResult, type AccessSource, type AccessUser, type ActionModel, type ActionRun, type AddressCheck, type AppAddress, type AssistantAction, type AssistantActionRequest, type AssistantCardPart, type AssistantDiff, type AssistantEvent, type AssistantMessage, type AssistantMessageRequest, type AssistantPart, type AssistantState, type AssistantStep, type AssistantStepState, type AssistantTablePart, type AssistantTextPart, type AssistantTone, type AssistantWidgetPart, type BadgeShape, type BottomBarItemModel, type BottomBarModel, type BottomBarNames, type BottomBarSource, type Capability, type CapabilityAction, type CapabilityLimit, type CapabilityScope, type CardPhotosModel, type ChartGranularity, type ChartModel, type ChartRange, type CheckResult, type CheckedFilter, type CompareOp, type ComponentRef, type CustomSectionModel, type DatePreset, type DurationLiteral, type DurationUnit, type EvaluateOptions, type EventActor, type EventContext, type EventHelpers, type EventMatch, type EventModel, type EventOperation, type EventSpec, type Field, type FieldAccess, type FieldFormat, type FieldModel, type FieldPath, type FieldRefValue, type FieldRule, type FieldType, type FieldViewModel, type FieldWidgetModel, type FileField, type FileFieldModel, type FileProcessor, type FileProcessorInput, type FilterError, type FilterErrorCode, type FilterExpr, type FilterLayout, type FilterLimits, type FilterOf, type FilterParse, type FilterValue, type FilterWidgetModel, type InferRecord, type JsonValue, type KeyType, type KeyValue, type LayoutItemModel, type ListDisplayModel, type ListModel, type ListQuery, type Literal, type MapSectionModel, type NavModel, type NavRecentModel, type NowValue, type OrderByCheck, type OrderByItem, type OrderByParse, type PluginHost, type PluginRequirement, type PropShapes, type RecordKey, type RefShape, type RelatedModel, type ResolveOptions, type ResolvedAccess, type ResourceModel, type RoleEntry, type RoleLimit, type Roles, type RolesOptions, type RowFilterOperation, type Rule, type SaveFeedback, type SearchMatch, type SearchResultModel, type SearchTerm, type SortSpec, type Span, type StatusTone, type UserMenuItemModel, type UserMenuModel, type UserMenuSource, type ViewModel, type ViewProps, accessWarnings, addressErrors, addressPlaceholders, addressWords, anonymousRole, appHrefError, appPath, applyAssistantEvent, bottomBar, bottomBarErrors, bottomBarFor, checkEventFilter, checkFilter, checkOrderBy, checkRecord, checkedAccept, checkedProvider, createWhere, decodeKey, defaultRecentLimit, defineRoles, displayFields, emptyAssistantState, encodeKey, enumLabel, evaluateFilter, f, fieldRef, fieldRefsIn, fieldsUsedBy, fillAddress, hrefPlaceholders, inRange, isFieldRef, keyTypes, layout as l, leavesApp, markFieldRefs, matchedSearchField, matchesSearch, maxBottomBarItems, navRecentErrors, parseFilter, parseOrderBy, parseSize, pickView, pluginProblem, printFilter, printOrderBy, pruneByShape, readAppPath, readEventStream, redactSecrets, resolveAccess, resource, restrictModel, rule, searchTerms, shapes, statusTones, tableDisplay, termMatches, unmarkFieldRefs, userMenu, view, webhookResources, where };
|
package/dist/layout.d.ts
CHANGED
|
@@ -9,6 +9,17 @@ export declare const layout: {
|
|
|
9
9
|
sidebar: (fields: Ref[]) => LayoutItemModel;
|
|
10
10
|
/** A table of the records of another resource that point at this one, directly or through a join table. */
|
|
11
11
|
related: (title: string, o: Omit<RelatedModel, "kind" | "title">) => LayoutItemModel;
|
|
12
|
+
/**
|
|
13
|
+
* A map with a marker at the record's position, read from two fields in decimal degrees (WGS84), at `zoom` (default
|
|
14
|
+
* 15): in the main column, or in the sidebar with `sidebar: true`. The app draws it with the map style of the server's
|
|
15
|
+
* `maps` option or `PROTOBASE_MAP_STYLE_URL`, and leaves it out without one, or for a record without a position.
|
|
16
|
+
*/
|
|
17
|
+
map: (title: string, o: {
|
|
18
|
+
latitude: Ref;
|
|
19
|
+
longitude: Ref;
|
|
20
|
+
zoom?: number;
|
|
21
|
+
sidebar?: boolean;
|
|
22
|
+
}) => LayoutItemModel;
|
|
12
23
|
/**
|
|
13
24
|
* A component of the project, registered in `protobase.ui.tsx` under its name, drawn where it is listed: in the main
|
|
14
25
|
* column, or in the sidebar with `sidebar: true`. The record page stays around it, with its title, breadcrumbs,
|
package/dist/layout.js
CHANGED
|
@@ -19,6 +19,19 @@ const layout = {
|
|
|
19
19
|
...structuredClone(o)
|
|
20
20
|
}),
|
|
21
21
|
/**
|
|
22
|
+
* A map with a marker at the record's position, read from two fields in decimal degrees (WGS84), at `zoom` (default
|
|
23
|
+
* 15): in the main column, or in the sidebar with `sidebar: true`. The app draws it with the map style of the server's
|
|
24
|
+
* `maps` option or `PROTOBASE_MAP_STYLE_URL`, and leaves it out without one, or for a record without a position.
|
|
25
|
+
*/
|
|
26
|
+
map: (title, o) => ({
|
|
27
|
+
kind: "map",
|
|
28
|
+
title,
|
|
29
|
+
latitude: o.latitude.name,
|
|
30
|
+
longitude: o.longitude.name,
|
|
31
|
+
...o.zoom !== void 0 && { zoom: o.zoom },
|
|
32
|
+
...o.sidebar && { sidebar: true }
|
|
33
|
+
}),
|
|
34
|
+
/**
|
|
22
35
|
* A component of the project, registered in `protobase.ui.tsx` under its name, drawn where it is listed: in the main
|
|
23
36
|
* column, or in the sidebar with `sidebar: true`. The record page stays around it, with its title, breadcrumbs,
|
|
24
37
|
* actions and save; the component reads the record with `useLayoutRecord()`.
|
package/dist/model.d.ts
CHANGED
|
@@ -240,6 +240,19 @@ export type CustomSectionModel = {
|
|
|
240
240
|
props?: Record<string, JsonValue>;
|
|
241
241
|
sidebar?: true;
|
|
242
242
|
};
|
|
243
|
+
/**
|
|
244
|
+
* A map of the record's position, its `latitude` and `longitude` fields in decimal degrees (WGS84), centred on a marker
|
|
245
|
+
* at `zoom`: in the main column under `title`, or with `sidebar` as a sidebar card. The app draws it with the map style
|
|
246
|
+
* its server names, and leaves it out without one.
|
|
247
|
+
*/
|
|
248
|
+
export type MapSectionModel = {
|
|
249
|
+
kind: 'map';
|
|
250
|
+
title: string;
|
|
251
|
+
latitude: string;
|
|
252
|
+
longitude: string;
|
|
253
|
+
zoom?: number;
|
|
254
|
+
sidebar?: true;
|
|
255
|
+
};
|
|
243
256
|
export type LayoutItemModel = {
|
|
244
257
|
kind: 'section';
|
|
245
258
|
title: string;
|
|
@@ -248,7 +261,7 @@ export type LayoutItemModel = {
|
|
|
248
261
|
} | {
|
|
249
262
|
kind: 'sidebar';
|
|
250
263
|
fields: string[];
|
|
251
|
-
} | RelatedModel | CustomSectionModel;
|
|
264
|
+
} | RelatedModel | CustomSectionModel | MapSectionModel;
|
|
252
265
|
export type ChartRange = '7d' | '30d' | '90d' | '1y' | 'all';
|
|
253
266
|
export type ChartGranularity = 'hour' | 'day' | 'week' | 'month';
|
|
254
267
|
export type ChartModel = {
|