@zerotal/admin 1.7.4 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/api-surface.md +3 -58
  2. package/package.json +9 -9
package/api-surface.md CHANGED
@@ -87,6 +87,7 @@ class AdminPage = {
87
87
  static cluster?: typeof Cluster
88
88
  static durable?: boolean | { ttl?: string; scope?: 'user' | 'session';}
89
89
  static getNavigationLabel: () => string
90
+ static interactive?: boolean
90
91
  static layout: any
91
92
  static navigationBadge?: () => Promise<string | number | null> | string | number | null
92
93
  static navigationBadgeColor?: BadgeTone
@@ -122,6 +123,7 @@ class AdminPage = {
122
123
  _prevChildIds: string[]
123
124
  _redirectStatus: number | null
124
125
  _redirectUrl: string | null
126
+ _renderStaticChild: <C extends Component>(ChildClass: new () => C, opts: { props?: Partial<C>; slots?: Record<string, string>;}) => Promise<string>
125
127
  _resolveTitle: () => string | null
126
128
  _shouldRefresh: boolean
127
129
  _streamSender: ((ref: string, content: string, replace: boolean) => void) | null
@@ -141,6 +143,7 @@ class AdminPage = {
141
143
  errors: ErrorsProxy
142
144
  flash: (message: string, optionsOrLevel?: FlashLevel | FlashOptions) => FlashBuilder
143
145
  hasSlot: (name?: string) => boolean
146
+ isInteractive: boolean
144
147
  layout: (page: HtmlNode) => HtmlNode | Promise<HtmlNode>
145
148
  navigateCurrent: (options?: CurrentUrlOptions) => Promise<void>
146
149
  onBoot: (_ctx?: HttpContext) => Promise<void>
@@ -871,26 +874,10 @@ class WizardStep = {
871
874
  schema: (fields: Field[]) => WizardStep
872
875
  }
873
876
 
874
- const DEFAULT_ADMIN_CONFIG = AdminConfigShape
875
-
876
- const DEFAULT_PANEL_ID = 'admin'
877
-
878
- const EMPTY_LAYOUT = DashboardLayout
879
-
880
- const IMPERSONATOR_KEY = 'admin.impersonator'
881
-
882
- const IMPORT_ROW_LIMIT = 2000
883
-
884
- const MAPPING_FIELD_PREFIX = 'map_'
885
-
886
877
  const NOTIFICATION_CHANNEL = 'admin-notifications'
887
878
 
888
879
  const NOTIFICATION_EVENT = '.notification.sent'
889
880
 
890
- const THEME_STORAGE_KEY = 'zerotal-theme'
891
-
892
- const VIEW_PARAMS = readonly ['search', 'filters', 'tab', 'sortBy', 'sortDir', 'sort', 'trashed', 'perPage', 'cols', 'group']
893
-
894
881
  function action = (key: string) => Action
895
882
 
896
883
  function actionGroup = (actions: Action[]) => ActionGroup
@@ -903,8 +890,6 @@ function adminTailwindConfig = () => string
903
890
 
904
891
  function adminTokensCss = () => string
905
892
 
906
- function applyLayout = <T>(widgets: T[], keyOf: (widget: T, index: number) => string, layout: DashboardLayout | null) => { visible: T[]; hidden: { key: string; widget: T; }[];}
907
-
908
893
  function authRoles = (options?: AuthRolesOptions) => RoleProvider
909
894
 
910
895
  function belongsToMany = (resource: ResourceClass, relationName: string) => RelationManager
@@ -961,8 +946,6 @@ function deleteAction = () => Action
961
946
 
962
947
  function deleteMedia = (item: MediaItem, options: { provider: MediaProvider; disk?: string;}) => Promise<[true] | [false, string]>
963
948
 
964
- function describeRuleTree = (node: QueryRule | null, filter?: { _constraints: Constraint[];}) => string
965
-
966
949
  function dispatchImport = (payload: ImportRecordsPayload) => Promise<boolean>
967
950
 
968
951
  function editAction = () => Action
@@ -973,10 +956,6 @@ function fieldset = (legend?: string) => FormSection
973
956
 
974
957
  function fileUpload = (key: string) => Field
975
958
 
976
- function flattenActions = (items: ActionItem[]) => Action[]
977
-
978
- function flattenFields = (components: FormComponent[]) => Field[]
979
-
980
959
  function forceDeleteAction = () => Action
981
960
 
982
961
  function formatSize = (bytes: number) => string
@@ -989,10 +968,6 @@ function formTabs = (tabs: FormTab[]) => FormTabs
989
968
 
990
969
  function group = (column: string) => Group
991
970
 
992
- function groupPermissions = (permissions: Permission[]) => { group: string; items: Permission[];}[]
993
-
994
- function guessColumnMapping = (headers: string[], candidates: { key: string; label: string;}[]) => Record<number, string>
995
-
996
971
  function hasMany = (resource: ResourceClass, foreignKey: string) => RelationManager
997
972
 
998
973
  function hidden = (key: string) => Field
@@ -1013,20 +988,12 @@ function importAction = (options?: { queue?: boolean;}) => Action
1013
988
 
1014
989
  function importCsv = (resource: ResourceClass, csv: string, mapping?: Record<number, string>, options?: { limit?: number;}) => Promise<ImportResult>
1015
990
 
1016
- function isFormSection = (c: FormComponent) => c is FormSection
1017
-
1018
- function isImage = (item: MediaItem) => boolean
1019
-
1020
991
  function isImpersonating = () => Promise<boolean>
1021
992
 
1022
- function isUpload = (value: unknown) => value is UploadedFileLike
1023
-
1024
993
  function keyValue = (key: string) => Field
1025
994
 
1026
995
  function keyValueEntry = (key: string) => Entry
1027
996
 
1028
- function makeResourceForm = (schema: FormComponent[], mode: FieldMode, className: string) => { FormClass: ResourceFormClass; fields: Field[];}
1029
-
1030
997
  function markdownEditor = (key: string) => Field
1031
998
 
1032
999
  function mediaPath = (name: string, folder?: string) => string
@@ -1035,16 +1002,12 @@ function mediaPicker = (key: string) => Field
1035
1002
 
1036
1003
  function mediaUrl = (item: MediaItem, disk?: string) => Promise<string | null>
1037
1004
 
1038
- function moveKey = (order: string[], key: string, direction: -1 | 1) => string[]
1039
-
1040
1005
  function numberConstraint = (key: string) => Constraint
1041
1006
 
1042
1007
  function panelPermissions = (panel: PanelInstance) => Permission[]
1043
1008
 
1044
1009
  function parseCsv = (text: string) => string[][]
1045
1010
 
1046
- function parseRuleTree = (value: string) => QueryRule | null
1047
-
1048
1011
  function prime = (text: string) => Prime
1049
1012
 
1050
1013
  function primeHtml = (html: string) => Prime
@@ -1055,8 +1018,6 @@ function queryBuilder = (key: string) => Filter
1055
1018
 
1056
1019
  function radio = (key: string) => Field
1057
1020
 
1058
- function reconcile = (layout: DashboardLayout | null, keys: string[]) => DashboardLayout
1059
-
1060
1021
  function recordHistory = (options: HistoryOptions) => Promise<HistoryEntry[]>
1061
1022
 
1062
1023
  function repeatableEntry = (key: string) => Entry
@@ -1067,18 +1028,12 @@ function replicateAction = () => Action
1067
1028
 
1068
1029
  function resolveMediaSrc = (value: unknown, disk?: string) => string | null
1069
1030
 
1070
- function resolveRenderHooks = (hooks: RenderHook[], context?: RenderHookContext) => (HtmlNode | string)[]
1071
-
1072
1031
  function restoreAction = () => Action
1073
1032
 
1074
- function revertPayload = (entry: HistoryEntry) => Record<string, unknown>
1075
-
1076
1033
  function richEditor = (key: string) => Field
1077
1034
 
1078
1035
  function roleHas = (role: Role, held: string[], key: string) => boolean
1079
1036
 
1080
- function ruleTreeIsEmpty = (node: QueryRule | null) => boolean
1081
-
1082
1037
  function runQueuedImport = (payload: ImportRecordsPayload) => Promise<ImportResult>
1083
1038
 
1084
1039
  function section = (heading?: string) => Section
@@ -1131,10 +1086,6 @@ function timePicker = (key: string) => Field
1131
1086
 
1132
1087
  function toCsv = (rows: Record<string, unknown>[], columns: Column[]) => string
1133
1088
 
1134
- function toFormLayout = (components: FormComponent[]) => FormBlock[]
1135
-
1136
- function toFormSections = (components: FormComponent[]) => FormSection[]
1137
-
1138
1089
  function toggle = (key: string) => Field
1139
1090
 
1140
1091
  function toggleButtons = (key: string) => Field
@@ -1145,12 +1096,6 @@ function toXlsx = (rows: Record<string, unknown>[], columns: Column[], options?:
1145
1096
 
1146
1097
  function viewAction = () => Action
1147
1098
 
1148
- function viewIsActive = (view: SavedView, current: URLSearchParams | string) => boolean
1149
-
1150
- function viewQuery = (params: URLSearchParams | string) => string
1151
-
1152
- function widgetPollInterval = (widgets: DashboardWidget[]) => string | undefined
1153
-
1154
1099
  function wizard = (steps: WizardStep[]) => Wizard
1155
1100
 
1156
1101
  function wizardStep = (label: string) => WizardStep
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerotal/admin",
3
- "version": "1.7.4",
3
+ "version": "1.8.0",
4
4
  "license": "MIT",
5
5
  "maturity": "stable",
6
6
  "private": false,
@@ -32,16 +32,16 @@
32
32
  "typecheck": "tsc --noEmit"
33
33
  },
34
34
  "dependencies": {
35
- "@zerotal/cache": "1.7.4",
36
- "@zerotal/core": "1.7.4",
37
- "@zerotal/flow": "1.7.4",
38
- "@zerotal/flow-ui": "1.7.4",
39
- "@zerotal/validator": "1.7.4"
35
+ "@zerotal/cache": "1.8.0",
36
+ "@zerotal/core": "1.8.0",
37
+ "@zerotal/flow": "1.8.0",
38
+ "@zerotal/flow-ui": "1.8.0",
39
+ "@zerotal/validator": "1.8.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@zerotal/orm": "1.7.4",
43
- "@zerotal/auth": "1.7.4",
44
- "@zerotal/queue": "1.7.4"
42
+ "@zerotal/orm": "1.8.0",
43
+ "@zerotal/auth": "1.8.0",
44
+ "@zerotal/queue": "1.8.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@zerotal/orm": "^1.0.0",