@selfhelp/shared 1.22.1 → 1.24.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.
- package/CHANGELOG.md +128 -0
- package/dist/index.d.mts +308 -100
- package/dist/index.d.ts +308 -100
- package/dist/index.js +519 -3
- package/dist/index.mjs +495 -3
- package/dist/plugin-sdk/index.d.mts +1 -1
- package/dist/plugin-sdk/index.d.ts +1 -1
- package/dist/plugin-sdk/index.js +3 -1
- package/dist/plugin-sdk/index.mjs +3 -1
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.d.ts +2 -2
- package/dist/registry/index.js +3 -1
- package/dist/registry/index.mjs +3 -1
- package/dist/{styles.registry-DylfiWW_.d.ts → styles.registry-BKWoDg7q.d.ts} +756 -6
- package/dist/{styles.registry-Dl55-gWX.d.mts → styles.registry-aopb3vsI.d.mts} +756 -6
- package/package.json +1 -1
- package/src/api/__tests__/endpoints.test.ts +45 -0
- package/src/api/__tests__/formListErrors.test.ts +143 -0
- package/src/api/endpoints.ts +41 -0
- package/src/api/formListErrors.ts +134 -0
- package/src/api/index.ts +1 -0
- package/src/content/__tests__/formListState.test.ts +448 -0
- package/src/content/__tests__/formRecordPrefill.test.ts +120 -0
- package/src/content/formListState.ts +559 -0
- package/src/content/formRecordPrefill.ts +108 -5
- package/src/content/index.ts +1 -0
- package/src/registry/__tests__/platform.test.ts +15 -6
- package/src/registry/styles.registry.ts +2 -0
- package/src/types/__tests__/version-about.test.ts +80 -0
- package/src/types/api/__tests__/formWrites.test.ts +84 -0
- package/src/types/api/__tests__/system.test.ts +10 -0
- package/src/types/api/form-lists.ts +469 -0
- package/src/types/api/forms.ts +149 -4
- package/src/types/api/index.ts +1 -0
- package/src/types/api/system.ts +9 -0
- package/src/types/styles/composite.ts +13 -0
- package/src/types/styles/error.ts +54 -4
- package/src/types/styles/forms.ts +84 -0
- package/src/types/styles/unknown.ts +5 -1
|
@@ -662,6 +662,597 @@ interface INotificationStyle extends IStyleWithSpacing {
|
|
|
662
662
|
radius?: IContentField<TSharedRadius>;
|
|
663
663
|
}
|
|
664
664
|
|
|
665
|
+
/**
|
|
666
|
+
* Common API envelope returned by the Symfony backend's ApiResponseFormatter.
|
|
667
|
+
*/
|
|
668
|
+
interface IApiMeta {
|
|
669
|
+
version: string;
|
|
670
|
+
timestamp: string;
|
|
671
|
+
}
|
|
672
|
+
type IMeta = IApiMeta;
|
|
673
|
+
interface IBaseApiResponse<TData> {
|
|
674
|
+
status: number;
|
|
675
|
+
message: string;
|
|
676
|
+
error: null | string;
|
|
677
|
+
error_type?: string;
|
|
678
|
+
logged_in: boolean;
|
|
679
|
+
meta: IApiMeta;
|
|
680
|
+
data: TData;
|
|
681
|
+
}
|
|
682
|
+
interface IApiError {
|
|
683
|
+
status: number;
|
|
684
|
+
message: string;
|
|
685
|
+
error: string;
|
|
686
|
+
error_type?: string;
|
|
687
|
+
logged_in?: boolean;
|
|
688
|
+
meta?: IApiMeta;
|
|
689
|
+
data?: unknown;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/** `data` of a 409 form-write envelope (re-exported for form consumers). */
|
|
693
|
+
type TFormConflictData = IFormStaleVersionData;
|
|
694
|
+
/**
|
|
695
|
+
* Which configuration a form or list request acts on: every write (submit,
|
|
696
|
+
* update, delete, quick action, restore) and every list read (state, history,
|
|
697
|
+
* version, comparison, historical file). The server decides what is allowed;
|
|
698
|
+
* the client only says which version of the page it is looking at.
|
|
699
|
+
*/
|
|
700
|
+
interface IFormEffectiveContext {
|
|
701
|
+
/**
|
|
702
|
+
* Act on the DRAFT of the page instead of its published version. Send it
|
|
703
|
+
* exactly when the person looks at the draft (the page was fetched with
|
|
704
|
+
* `preview`): the request must be judged by the same inputs, conditions,
|
|
705
|
+
* list properties and quick actions the person sees. Honoured for a
|
|
706
|
+
* signed-in person who may read the draft, refused otherwise; without it the
|
|
707
|
+
* published version decides, also for a signed-in person. Page access
|
|
708
|
+
* rights, live data and permissions are not part of the draft and stay the
|
|
709
|
+
* same. A request body carries it as a boolean, a query string as `preview=true`.
|
|
710
|
+
*/
|
|
711
|
+
preview?: boolean;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* `form_data` holds the values of the inputs of the form the server resolves for
|
|
715
|
+
* `section_id` (keyed by input name). It is untrusted: the server refuses (400)
|
|
716
|
+
* an unknown input, an owner or trigger field and any internal key, on JSON and
|
|
717
|
+
* on multipart requests, signed in or as a guest.
|
|
718
|
+
*/
|
|
719
|
+
interface IFormSubmitRequest extends IFormEffectiveContext {
|
|
720
|
+
section_id: number;
|
|
721
|
+
page_id?: number;
|
|
722
|
+
record_id?: number;
|
|
723
|
+
form_data: Record<string, unknown>;
|
|
724
|
+
}
|
|
725
|
+
interface IFormUpdateRequest extends IFormEffectiveContext {
|
|
726
|
+
section_id: number;
|
|
727
|
+
page_id?: number;
|
|
728
|
+
record_id?: number;
|
|
729
|
+
form_data: Record<string, unknown>;
|
|
730
|
+
/**
|
|
731
|
+
* The record the update changes: `{ record_id }` alone, or the documented
|
|
732
|
+
* alternative of plain field values. Anything else (empty, both, malformed)
|
|
733
|
+
* answers 400 `unsupported_target_selection`; a record outside the dataset
|
|
734
|
+
* of the form or list answers 404.
|
|
735
|
+
*/
|
|
736
|
+
update_based_on?: Record<string, unknown>;
|
|
737
|
+
/**
|
|
738
|
+
* REQUIRED: the record `version` the change is based on (the `version` the
|
|
739
|
+
* client last received from the record, a list row or the previous write).
|
|
740
|
+
* Missing, not a whole number of at least 1 (also as multipart text) answers
|
|
741
|
+
* 400 `expected_version_required` / `invalid_expected_version` before
|
|
742
|
+
* anything is stored; a save based on an older version answers 409 with
|
|
743
|
+
* {@link IFormStaleVersionData} and writes nothing. The schema marks it
|
|
744
|
+
* optional only so the refusal can carry its reason; the type does not.
|
|
745
|
+
*/
|
|
746
|
+
expected_version: number;
|
|
747
|
+
}
|
|
748
|
+
interface IFormDeleteRequest extends IFormEffectiveContext {
|
|
749
|
+
record_id: number;
|
|
750
|
+
page_id?: number;
|
|
751
|
+
/** The form's section, or the id of the entry list the record belongs to. */
|
|
752
|
+
section_id: number;
|
|
753
|
+
/**
|
|
754
|
+
* REQUIRED: the record `version` the delete is based on, with the same
|
|
755
|
+
* refusals as {@link IFormUpdateRequest.expected_version} (400 when missing
|
|
756
|
+
* or malformed, 409 `stale_version` when old).
|
|
757
|
+
*/
|
|
758
|
+
expected_version: number;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* The rule of an input a value broke (`422 invalid_form_data`). The server
|
|
762
|
+
* checks the CURRENT effective form: `required`, `read_only` and `not_available`
|
|
763
|
+
* (hidden by a condition or not an input of the form), `invalid` (not a value
|
|
764
|
+
* this kind of input takes), `too_many` (selections or files), `type`, `min`,
|
|
765
|
+
* `max`, `max_length`, `format` (email, web address), `option`, `min_date`,
|
|
766
|
+
* `max_date` and `file_type`.
|
|
767
|
+
*/
|
|
768
|
+
type TFormInputRule = 'not_available' | 'read_only' | 'required' | 'invalid' | 'too_many' | 'type' | 'min' | 'max' | 'max_length' | 'format' | 'option' | 'min_date' | 'max_date' | 'file_type';
|
|
769
|
+
/** One refused input of a write. Show `message` at the input named `field`; branch on `rule`, never on the text. */
|
|
770
|
+
interface IFormInputError {
|
|
771
|
+
/** The input's name, as the person knows it. */
|
|
772
|
+
field: string;
|
|
773
|
+
/** The stable column key of the input (`section_<input id>`). */
|
|
774
|
+
key: string;
|
|
775
|
+
rule: TFormInputRule;
|
|
776
|
+
message: string;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* `data` of the 422 envelope a write answers with when a value breaks the rules
|
|
780
|
+
* of the CURRENT form (a save, a quick action's candidate state or a restore). The
|
|
781
|
+
* whole write is refused: nothing was stored, uploaded or scheduled, so a client
|
|
782
|
+
* keeps the person's draft and files and shows the errors.
|
|
783
|
+
*/
|
|
784
|
+
interface IFormInvalidData {
|
|
785
|
+
reason: 'invalid_form_data';
|
|
786
|
+
errors: IFormInputError[];
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* The `data.reason` of the refusals a form or list write can answer with, besides
|
|
790
|
+
* `stale_version` and `restore_blocked` ({@link IFormStaleVersionData},
|
|
791
|
+
* {@link IFormListRestoreBlockedData}) and `invalid_form_data`
|
|
792
|
+
* ({@link IFormInvalidData}). They are statuses of one request, not page state.
|
|
793
|
+
*
|
|
794
|
+
* - 400: `expected_version_required`, `invalid_expected_version`,
|
|
795
|
+
* `unsupported_target_selection`, `protected_field`, `unknown_field`,
|
|
796
|
+
* `invalid_file_value`, `table_mismatch`.
|
|
797
|
+
* - 401 `login_required`: a guest on an own-entries list.
|
|
798
|
+
* - 403: `operation_disabled` (create, update or delete switched off on the list),
|
|
799
|
+
* `history_disabled`, or no right to the page, the record or the table.
|
|
800
|
+
* - 404: `unknown_action`, or a record that is not part of the list's dataset
|
|
801
|
+
* (never a hint whether it exists elsewhere).
|
|
802
|
+
* - 409: `action_not_available` (the action's condition no longer holds).
|
|
803
|
+
*/
|
|
804
|
+
type TFormWriteRefusalReason = 'expected_version_required' | 'invalid_expected_version' | 'unsupported_target_selection' | 'protected_field' | 'unknown_field' | 'invalid_file_value' | 'table_mismatch' | 'login_required' | 'operation_disabled' | 'history_disabled' | 'unknown_action' | 'action_not_available';
|
|
805
|
+
/**
|
|
806
|
+
* Legacy/aspirational form-result fields.
|
|
807
|
+
*
|
|
808
|
+
* @deprecated The current backend `form_submitted` / `form_updated` responses
|
|
809
|
+
* do NOT include these. `FormController` returns only the structured fields on
|
|
810
|
+
* {@link IFormSubmitData} / {@link IFormUpdateData}, and both JSON schemas
|
|
811
|
+
* declare `additionalProperties: false`. Frontend code that reads
|
|
812
|
+
* `data.success` / `data.message` (e.g. `useFormSubmission.ts`) is reading
|
|
813
|
+
* values the backend never sends. Kept OPTIONAL so consumers keep compiling
|
|
814
|
+
* during migration; drop them once no consumer references them.
|
|
815
|
+
*/
|
|
816
|
+
interface IFormResultLegacyFields {
|
|
817
|
+
/** @deprecated Not returned by the current backend form endpoints. */
|
|
818
|
+
success?: boolean;
|
|
819
|
+
/** @deprecated Not returned by the current backend form endpoints. */
|
|
820
|
+
redirect_url?: string;
|
|
821
|
+
/** @deprecated Not returned by the current backend form endpoints. */
|
|
822
|
+
message?: string;
|
|
823
|
+
/** @deprecated Not returned by the current backend form endpoints. */
|
|
824
|
+
field_errors?: Record<string, string>;
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Data returned by a successful POST form submit. Mirrors the backend contract
|
|
828
|
+
* `config/schemas/api/v1/responses/frontend/form_submitted.json`.
|
|
829
|
+
*/
|
|
830
|
+
interface IFormSubmitData extends IFormResultLegacyFields {
|
|
831
|
+
record_id: number;
|
|
832
|
+
section_id: number;
|
|
833
|
+
page_id: number;
|
|
834
|
+
submitted_at: string;
|
|
835
|
+
user_authenticated: boolean;
|
|
836
|
+
/** The record's version after the submit (1 for a new record). */
|
|
837
|
+
version: number;
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Data returned by a successful PUT form update. Mirrors the backend contract
|
|
841
|
+
* `config/schemas/api/v1/responses/frontend/form_updated.json` (note: the
|
|
842
|
+
* update response carries `updated_at`, not `submitted_at`/`user_authenticated`).
|
|
843
|
+
*/
|
|
844
|
+
interface IFormUpdateData extends IFormResultLegacyFields {
|
|
845
|
+
record_id: number;
|
|
846
|
+
section_id: number;
|
|
847
|
+
page_id: number;
|
|
848
|
+
updated_at: string;
|
|
849
|
+
/** The record's version after the update. */
|
|
850
|
+
version: number;
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* Data returned by a successful DELETE form delete. Mirrors the backend contract
|
|
854
|
+
* `config/schemas/api/v1/responses/frontend/form_deleted.json`. The delete is
|
|
855
|
+
* soft: the record's history is kept.
|
|
856
|
+
*/
|
|
857
|
+
interface IFormDeleteData extends IFormResultLegacyFields {
|
|
858
|
+
record_id: number;
|
|
859
|
+
section_id?: number;
|
|
860
|
+
page_id?: number;
|
|
861
|
+
/** The record's version after the delete. */
|
|
862
|
+
version: number;
|
|
863
|
+
}
|
|
864
|
+
type IFormSubmitResponse = IBaseApiResponse<IFormSubmitData>;
|
|
865
|
+
type IFormUpdateResponse = IBaseApiResponse<IFormUpdateData>;
|
|
866
|
+
type IFormDeleteResponse = IBaseApiResponse<IFormDeleteData>;
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* DTOs of the `entry-form-list` and `data-view` styles ("lists").
|
|
870
|
+
*
|
|
871
|
+
* They mirror the backend contracts under
|
|
872
|
+
* `config/schemas/api/v1/{common/_form_list_state,common/_form_list_error,
|
|
873
|
+
* responses/frontend/form_list_*,requests/frontend/list_*}.json` and
|
|
874
|
+
* `docs/reference/api/22-form-lists.md`. The server decides, clients draw:
|
|
875
|
+
* nothing in here lets a client evaluate access, conditions, filters or
|
|
876
|
+
* quick-action assignments. A list's state is read from the page payload
|
|
877
|
+
* (`list_state` / `list_error` on the section) or from
|
|
878
|
+
* `GET /cms-api/v1/lists/{section_id}/state`.
|
|
879
|
+
*/
|
|
880
|
+
|
|
881
|
+
type TFormListStyleName = 'entry-form-list' | 'data-view';
|
|
882
|
+
/**
|
|
883
|
+
* `custom` (a `data-view` only): the sections placed inside the view are the layout of one
|
|
884
|
+
* record; the server renders them per record into each row's `sections`.
|
|
885
|
+
*/
|
|
886
|
+
type TFormListLayout = 'table' | 'cards' | 'custom';
|
|
887
|
+
type TFormListPresentation = 'modal' | 'page';
|
|
888
|
+
type TFormListColumnFormat = 'text' | 'number' | 'date' | 'datetime' | 'boolean' | 'badge' | 'file' | 'image';
|
|
889
|
+
type TFormListControlType = 'text' | 'select' | 'multi_select' | 'boolean' | 'date_range' | 'number_range';
|
|
890
|
+
type TFormListTextMatch = 'contains' | 'eq' | 'starts_with';
|
|
891
|
+
type TFormListSortDirection = 'asc' | 'desc';
|
|
892
|
+
/** What the URL asks for next to a record: look at it, edit it, or start a new one. */
|
|
893
|
+
type TFormListMode = 'view' | 'edit' | 'create' | 'history';
|
|
894
|
+
/** The modes of an open record (`create` has no record). */
|
|
895
|
+
type TFormListOpenMode = Exclude<TFormListMode, 'create'>;
|
|
896
|
+
/** An uploaded file in a cell. `url` is a section-scoped download route; no storage path ever leaves the server. */
|
|
897
|
+
interface IFormListFileValue {
|
|
898
|
+
index: number;
|
|
899
|
+
name: string;
|
|
900
|
+
mime?: string | null;
|
|
901
|
+
size?: number | null;
|
|
902
|
+
url: string;
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* A file / image cell: the `files` list of contract 2. Format `image` is drawn as a
|
|
906
|
+
* thumbnail; `file` as download links. Never a bare array of files and never a storage key.
|
|
907
|
+
*/
|
|
908
|
+
interface IFormListFilesCell {
|
|
909
|
+
files: IFormListFileValue[];
|
|
910
|
+
}
|
|
911
|
+
/** A cell as the server sends it: text, a number, nothing, or a file/image cell. */
|
|
912
|
+
type TFormListCellValue = string | number | null | IFormListFilesCell;
|
|
913
|
+
/** Author text in the visitor's language. `add` and `confirm_delete` exist on `entry-form-list` only. */
|
|
914
|
+
type TFormListLabels = Partial<Record<'add' | 'empty' | 'search' | 'confirm_delete', string>>;
|
|
915
|
+
interface IFormListInfo {
|
|
916
|
+
section_id: number;
|
|
917
|
+
page_id: number;
|
|
918
|
+
/** The list's name in the URL: `<key>.page`, `<key>.q`, ... */
|
|
919
|
+
key: string;
|
|
920
|
+
style: TFormListStyleName;
|
|
921
|
+
layout: TFormListLayout;
|
|
922
|
+
form_presentation: TFormListPresentation;
|
|
923
|
+
/** The inline form that creates and edits records; null for a data view. */
|
|
924
|
+
form_section_id: number | null;
|
|
925
|
+
/** False while the list's form was never submitted: there is nothing to read yet. */
|
|
926
|
+
table_exists: boolean;
|
|
927
|
+
labels: TFormListLabels;
|
|
928
|
+
/** Classes of the element that holds the records of the `custom` layout (web only); empty otherwise. */
|
|
929
|
+
row_css: string;
|
|
930
|
+
/**
|
|
931
|
+
* True when the author placed sections inside a data view with the `custom` layout.
|
|
932
|
+
* A `custom` layout without any is drawn as cards.
|
|
933
|
+
*/
|
|
934
|
+
has_template: boolean;
|
|
935
|
+
}
|
|
936
|
+
interface IFormListColumn {
|
|
937
|
+
/** The key of `values` in rows. */
|
|
938
|
+
field: string;
|
|
939
|
+
label: string;
|
|
940
|
+
format: TFormListColumnFormat;
|
|
941
|
+
sortable: boolean;
|
|
942
|
+
searchable: boolean;
|
|
943
|
+
}
|
|
944
|
+
interface IFormListControlOption {
|
|
945
|
+
value: string;
|
|
946
|
+
label: string;
|
|
947
|
+
/** Records holding the value inside the visitor's dataset; null for fixed choices. */
|
|
948
|
+
count: number | null;
|
|
949
|
+
}
|
|
950
|
+
interface IFormListControl {
|
|
951
|
+
/** The `<key>.f.<id>` URL parameter. */
|
|
952
|
+
id: string;
|
|
953
|
+
type: TFormListControlType;
|
|
954
|
+
field: string;
|
|
955
|
+
label: string;
|
|
956
|
+
match?: TFormListTextMatch;
|
|
957
|
+
options?: IFormListControlOption[];
|
|
958
|
+
}
|
|
959
|
+
interface IFormListSort {
|
|
960
|
+
field: string;
|
|
961
|
+
direction: TFormListSortDirection;
|
|
962
|
+
}
|
|
963
|
+
/** The state that was served: the page after clamping, the order in effect, and the URL parameters that express it. */
|
|
964
|
+
interface IFormListServedState {
|
|
965
|
+
page: number;
|
|
966
|
+
page_size: number;
|
|
967
|
+
q: string | null;
|
|
968
|
+
sort: IFormListSort[];
|
|
969
|
+
/** Control id to the control's raw value. */
|
|
970
|
+
filters: Record<string, string>;
|
|
971
|
+
record: number | null;
|
|
972
|
+
mode: TFormListMode | null;
|
|
973
|
+
/** The URL parameters (`news.page`, `news.q`, ...) that express this state; build links from them. */
|
|
974
|
+
query: Record<string, string>;
|
|
975
|
+
}
|
|
976
|
+
interface IFormListQuickActionInfo {
|
|
977
|
+
id: string;
|
|
978
|
+
label: string;
|
|
979
|
+
confirm: string | null;
|
|
980
|
+
}
|
|
981
|
+
interface IFormListCapabilities {
|
|
982
|
+
/** False for a guest on an own-entries list. */
|
|
983
|
+
create: boolean;
|
|
984
|
+
search: boolean;
|
|
985
|
+
history: boolean;
|
|
986
|
+
/** Labels and confirmations; a row's `quick_actions` say which of them apply to it. */
|
|
987
|
+
quick_actions: IFormListQuickActionInfo[];
|
|
988
|
+
}
|
|
989
|
+
/** What the visitor may do with one record. These are rendering hints; the server re-checks on every write. */
|
|
990
|
+
interface IFormListRecordAccess {
|
|
991
|
+
is_own: boolean;
|
|
992
|
+
can_update: boolean;
|
|
993
|
+
can_delete: boolean;
|
|
994
|
+
can_view_history: boolean;
|
|
995
|
+
/** Ids of the quick actions whose condition holds now for this record. Offer no other. */
|
|
996
|
+
quick_actions: string[];
|
|
997
|
+
detail_url: string | null;
|
|
998
|
+
}
|
|
999
|
+
interface IFormListRow extends IFormListRecordAccess {
|
|
1000
|
+
record_id: number;
|
|
1001
|
+
entry_date: string;
|
|
1002
|
+
/** Send back as `expected_version` when changing the record. */
|
|
1003
|
+
version: number;
|
|
1004
|
+
/** Exactly the configured columns, by field. */
|
|
1005
|
+
values: Record<string, TFormListCellValue>;
|
|
1006
|
+
/**
|
|
1007
|
+
* Only with the `custom` layout: the author's row template rendered for this record, in the
|
|
1008
|
+
* shape of page sections (tokens, translations and conditions already resolved). Render them
|
|
1009
|
+
* like any other sections; never evaluate anything.
|
|
1010
|
+
*/
|
|
1011
|
+
sections?: TStyle[];
|
|
1012
|
+
}
|
|
1013
|
+
/** The record that is open (view or edit). */
|
|
1014
|
+
interface IFormListSelected extends IFormListRecordAccess {
|
|
1015
|
+
record_id: number;
|
|
1016
|
+
mode: TFormListOpenMode;
|
|
1017
|
+
entry_date: string;
|
|
1018
|
+
/** Send back as `expected_version` when saving, deleting, running an action or restoring. */
|
|
1019
|
+
version: number;
|
|
1020
|
+
values: Record<string, TFormListCellValue>;
|
|
1021
|
+
/** The prefill the inline form receives on a page load; null when the caller cannot edit the record. */
|
|
1022
|
+
form_values: Record<string, unknown> | unknown[] | null;
|
|
1023
|
+
}
|
|
1024
|
+
interface IFormListPagination {
|
|
1025
|
+
page: number;
|
|
1026
|
+
page_size: number;
|
|
1027
|
+
total: number;
|
|
1028
|
+
total_pages: number;
|
|
1029
|
+
}
|
|
1030
|
+
/** The server-rendered state of one list for one visitor and one URL state. */
|
|
1031
|
+
interface IFormListState {
|
|
1032
|
+
list: IFormListInfo;
|
|
1033
|
+
columns: IFormListColumn[];
|
|
1034
|
+
controls: IFormListControl[];
|
|
1035
|
+
state: IFormListServedState;
|
|
1036
|
+
capabilities: IFormListCapabilities;
|
|
1037
|
+
rows: IFormListRow[];
|
|
1038
|
+
pagination: IFormListPagination;
|
|
1039
|
+
selected: IFormListSelected | null;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* Why a list on a page has no state. The page is still served; the client draws
|
|
1043
|
+
* the list's error state. `parameter` names the URL parameter that caused it - a
|
|
1044
|
+
* client may drop it and retry.
|
|
1045
|
+
*/
|
|
1046
|
+
interface IFormListError {
|
|
1047
|
+
/** The HTTP status the state endpoint would answer with: 400, 401, 403, 404 or 500. */
|
|
1048
|
+
status: number;
|
|
1049
|
+
message: string;
|
|
1050
|
+
reason?: TFormListErrorReason | string | null;
|
|
1051
|
+
parameter?: string | null;
|
|
1052
|
+
}
|
|
1053
|
+
type TFormListErrorReason = 'login_required' | 'operation_disabled' | 'history_disabled' | 'invalid_list_parameter' | 'unknown_list_parameter' | 'duplicate_list_parameter' | 'field_not_allowed' | 'table_mismatch' | 'unknown_action' | 'stale_version' | 'action_not_available' | 'restore_blocked' | 'invalid_list_config';
|
|
1054
|
+
type IFormListStateResponse = IBaseApiResponse<IFormListState>;
|
|
1055
|
+
/**
|
|
1056
|
+
* `data` of the 409 envelope a stale save, delete, quick action or restore answers
|
|
1057
|
+
* with. Nothing was written: keep the draft and offer reload, comparison and re-apply.
|
|
1058
|
+
*/
|
|
1059
|
+
interface IFormStaleVersionData {
|
|
1060
|
+
reason: 'stale_version';
|
|
1061
|
+
record_id: number;
|
|
1062
|
+
expected_version: number;
|
|
1063
|
+
current_version: number;
|
|
1064
|
+
}
|
|
1065
|
+
interface IFormListQuickActionRequest extends IFormEffectiveContext {
|
|
1066
|
+
page_id: number;
|
|
1067
|
+
/** REQUIRED: the record `version` the action is based on; missing or malformed answers 400, an old one 409. */
|
|
1068
|
+
expected_version: number;
|
|
1069
|
+
}
|
|
1070
|
+
interface IFormListQuickActionData {
|
|
1071
|
+
record_id: number;
|
|
1072
|
+
/** The record's version after the action. */
|
|
1073
|
+
version: number;
|
|
1074
|
+
action: string;
|
|
1075
|
+
}
|
|
1076
|
+
type IFormListQuickActionResponse = IBaseApiResponse<IFormListQuickActionData>;
|
|
1077
|
+
type TDataRevisionOperation = 'create' | 'update' | 'delete' | 'restore' | 'baseline';
|
|
1078
|
+
type TDataRevisionSource = 'form' | 'admin' | 'quick_action' | 'job' | 'import' | 'system';
|
|
1079
|
+
interface IFormListActor {
|
|
1080
|
+
id: number;
|
|
1081
|
+
name: string | null;
|
|
1082
|
+
}
|
|
1083
|
+
/** One revision of a record: who changed it, how, and how much. */
|
|
1084
|
+
interface IFormListRevision {
|
|
1085
|
+
version: number;
|
|
1086
|
+
/** UTC, ISO 8601 (ATOM). */
|
|
1087
|
+
created_at: string;
|
|
1088
|
+
operation: TDataRevisionOperation;
|
|
1089
|
+
source: TDataRevisionSource;
|
|
1090
|
+
actor: IFormListActor | null;
|
|
1091
|
+
impersonated_by: IFormListActor | null;
|
|
1092
|
+
restored_from_version: number | null;
|
|
1093
|
+
/** The number of fields the revision changed. */
|
|
1094
|
+
changed_fields: number;
|
|
1095
|
+
is_checkpoint: boolean;
|
|
1096
|
+
}
|
|
1097
|
+
/** A file a revision held; `available` is false once the file was erased. */
|
|
1098
|
+
interface IFormListHistoricalFile {
|
|
1099
|
+
index: number;
|
|
1100
|
+
name: string;
|
|
1101
|
+
available: boolean;
|
|
1102
|
+
/** Historical-file download route when `available` (list or admin data browser). */
|
|
1103
|
+
url?: string;
|
|
1104
|
+
}
|
|
1105
|
+
/**
|
|
1106
|
+
* Explicit file-field instruction on update (contract 4). Omit the field to keep
|
|
1107
|
+
* files; send this object (or its JSON string in multipart) to clear or drop indexes.
|
|
1108
|
+
* A new upload then replaces (single-file) or appends (multi-file).
|
|
1109
|
+
*/
|
|
1110
|
+
interface IFormFileFieldOp {
|
|
1111
|
+
remove?: boolean;
|
|
1112
|
+
remove_indexes?: number[];
|
|
1113
|
+
}
|
|
1114
|
+
interface IFormListChangeBase {
|
|
1115
|
+
field_key: string;
|
|
1116
|
+
field_label: string | null;
|
|
1117
|
+
language_id: number;
|
|
1118
|
+
truncated: boolean;
|
|
1119
|
+
}
|
|
1120
|
+
interface IFormListValueChange extends IFormListChangeBase {
|
|
1121
|
+
change: 'added' | 'changed' | 'removed';
|
|
1122
|
+
kind: 'value';
|
|
1123
|
+
before: string | null;
|
|
1124
|
+
after: string | null;
|
|
1125
|
+
}
|
|
1126
|
+
interface IFormListFileChange extends IFormListChangeBase {
|
|
1127
|
+
change: 'added' | 'changed' | 'removed';
|
|
1128
|
+
kind: 'file';
|
|
1129
|
+
before: null;
|
|
1130
|
+
after: null;
|
|
1131
|
+
before_files: IFormListHistoricalFile[];
|
|
1132
|
+
after_files: IFormListHistoricalFile[];
|
|
1133
|
+
}
|
|
1134
|
+
/** A change of a revision or of a comparison. */
|
|
1135
|
+
type TFormListChange = IFormListValueChange | IFormListFileChange;
|
|
1136
|
+
/** A field of the record as it stood after a version. */
|
|
1137
|
+
interface IFormListStateField {
|
|
1138
|
+
field_key: string;
|
|
1139
|
+
field_label: string | null;
|
|
1140
|
+
language_id: number;
|
|
1141
|
+
kind: 'value' | 'file';
|
|
1142
|
+
value: string | null;
|
|
1143
|
+
files: IFormListHistoricalFile[];
|
|
1144
|
+
}
|
|
1145
|
+
interface IFormListHistoryQuery extends IFormEffectiveContext {
|
|
1146
|
+
page_id: number;
|
|
1147
|
+
page?: number;
|
|
1148
|
+
/** 1 to 100, default 20. */
|
|
1149
|
+
page_size?: number;
|
|
1150
|
+
}
|
|
1151
|
+
interface IFormListHistoryData {
|
|
1152
|
+
/** Newest first. */
|
|
1153
|
+
items: IFormListRevision[];
|
|
1154
|
+
total: number;
|
|
1155
|
+
page: number;
|
|
1156
|
+
page_size: number;
|
|
1157
|
+
current_version: number;
|
|
1158
|
+
}
|
|
1159
|
+
interface IFormListVersionData {
|
|
1160
|
+
revision: {
|
|
1161
|
+
revision: IFormListRevision;
|
|
1162
|
+
changes: TFormListChange[];
|
|
1163
|
+
};
|
|
1164
|
+
state: {
|
|
1165
|
+
version: number;
|
|
1166
|
+
current_version: number;
|
|
1167
|
+
fields: IFormListStateField[];
|
|
1168
|
+
};
|
|
1169
|
+
}
|
|
1170
|
+
interface IFormListCompareQuery extends IFormEffectiveContext {
|
|
1171
|
+
page_id: number;
|
|
1172
|
+
from: number;
|
|
1173
|
+
to: number;
|
|
1174
|
+
}
|
|
1175
|
+
interface IFormListCompareData {
|
|
1176
|
+
from_version: number;
|
|
1177
|
+
to_version: number;
|
|
1178
|
+
current_version: number;
|
|
1179
|
+
changes: TFormListChange[];
|
|
1180
|
+
}
|
|
1181
|
+
type TFormListRestoreBlockerReason = 'field_missing' | 'language_missing' | 'file_unavailable' | 'invalid_value';
|
|
1182
|
+
/** Why one field of an earlier version cannot be written back today. */
|
|
1183
|
+
interface IFormListRestoreBlocker {
|
|
1184
|
+
field_key: string;
|
|
1185
|
+
field_label: string | null;
|
|
1186
|
+
language_id: number;
|
|
1187
|
+
reason: TFormListRestoreBlockerReason;
|
|
1188
|
+
detail: string | null;
|
|
1189
|
+
}
|
|
1190
|
+
/** What a restore would write: set a value (and files) or remove what that version did not have. */
|
|
1191
|
+
interface IFormListRestoreChange {
|
|
1192
|
+
field_key: string;
|
|
1193
|
+
field_label: string | null;
|
|
1194
|
+
language_id: number;
|
|
1195
|
+
action: 'set' | 'remove';
|
|
1196
|
+
kind: 'value' | 'file';
|
|
1197
|
+
before: string | null;
|
|
1198
|
+
after: string | null;
|
|
1199
|
+
before_files?: IFormListHistoricalFile[];
|
|
1200
|
+
after_files?: IFormListHistoricalFile[];
|
|
1201
|
+
}
|
|
1202
|
+
interface IFormListRestoreRequest extends IFormEffectiveContext {
|
|
1203
|
+
page_id: number;
|
|
1204
|
+
/** The earlier version to restore. */
|
|
1205
|
+
version: number;
|
|
1206
|
+
/**
|
|
1207
|
+
* The current version the person saw. REQUIRED for a real restore (missing or
|
|
1208
|
+
* malformed answers 400, an old one 409); a `dry_run` needs none.
|
|
1209
|
+
*/
|
|
1210
|
+
expected_version?: number;
|
|
1211
|
+
/** Restore only these fields (1 to 100) - the way to resolve a blocked restore. */
|
|
1212
|
+
field_keys?: string[];
|
|
1213
|
+
/** Only report what a restore would change and what blocks it; write nothing. */
|
|
1214
|
+
dry_run?: boolean;
|
|
1215
|
+
}
|
|
1216
|
+
interface IFormListRestorePreview {
|
|
1217
|
+
dry_run: true;
|
|
1218
|
+
restorable: boolean;
|
|
1219
|
+
record_id: number;
|
|
1220
|
+
from_version: number;
|
|
1221
|
+
current_version: number;
|
|
1222
|
+
changes: IFormListRestoreChange[];
|
|
1223
|
+
blockers: IFormListRestoreBlocker[];
|
|
1224
|
+
}
|
|
1225
|
+
interface IFormListRestoreResult {
|
|
1226
|
+
dry_run: false;
|
|
1227
|
+
record_id: number;
|
|
1228
|
+
restored_from_version: number;
|
|
1229
|
+
/** The record's version after the restore (unchanged when nothing differed). */
|
|
1230
|
+
version: number;
|
|
1231
|
+
}
|
|
1232
|
+
type TFormListRestoreData = IFormListRestorePreview | IFormListRestoreResult;
|
|
1233
|
+
/** `data` of the 422 envelope a restore that cannot be applied whole answers with. Nothing was applied. */
|
|
1234
|
+
interface IFormListRestoreBlockedData {
|
|
1235
|
+
reason: 'restore_blocked';
|
|
1236
|
+
record_id: number;
|
|
1237
|
+
from_version: number;
|
|
1238
|
+
blockers: IFormListRestoreBlocker[];
|
|
1239
|
+
}
|
|
1240
|
+
type IFormListHistoryResponse = IBaseApiResponse<IFormListHistoryData>;
|
|
1241
|
+
type IFormListVersionResponse = IBaseApiResponse<IFormListVersionData>;
|
|
1242
|
+
type IFormListCompareResponse = IBaseApiResponse<IFormListCompareData>;
|
|
1243
|
+
type IFormListRestoreResponse = IBaseApiResponse<TFormListRestoreData>;
|
|
1244
|
+
/** Restore body for the data browser (contract 6); no page context. */
|
|
1245
|
+
interface IAdminDataRecordRestoreRequest {
|
|
1246
|
+
version: number;
|
|
1247
|
+
expected_version?: number;
|
|
1248
|
+
field_keys?: string[];
|
|
1249
|
+
dry_run?: boolean;
|
|
1250
|
+
}
|
|
1251
|
+
type IAdminDataRecordHistoryResponse = IFormListHistoryResponse;
|
|
1252
|
+
type IAdminDataRecordVersionResponse = IFormListVersionResponse;
|
|
1253
|
+
type IAdminDataRecordCompareResponse = IFormListCompareResponse;
|
|
1254
|
+
type IAdminDataRecordRestoreResponse = IFormListRestoreResponse;
|
|
1255
|
+
|
|
665
1256
|
type TMantineTextInputVariant = 'default' | 'filled' | 'unstyled';
|
|
666
1257
|
type TMantineTextareaAutosize = '0' | '1';
|
|
667
1258
|
type TMantineTextareaResize = 'none' | 'vertical' | 'both';
|
|
@@ -1132,6 +1723,12 @@ interface IEntryTableEntry {
|
|
|
1132
1723
|
_can_delete?: boolean;
|
|
1133
1724
|
/** Per-row edit permission (backend rule `canUpdateOwnedRecord`). */
|
|
1134
1725
|
_can_edit?: boolean;
|
|
1726
|
+
/**
|
|
1727
|
+
* The version the record has when the page is built (present on rows that offer delete
|
|
1728
|
+
* or edit). Send it back as `expected_version`: a delete without it is refused (400), one
|
|
1729
|
+
* based on an old version is refused (409) and the record stays.
|
|
1730
|
+
*/
|
|
1731
|
+
_version?: number;
|
|
1135
1732
|
[key: string]: unknown;
|
|
1136
1733
|
}
|
|
1137
1734
|
/**
|
|
@@ -1202,6 +1799,75 @@ interface IEntryTableStyle extends IBaseStyle {
|
|
|
1202
1799
|
*/
|
|
1203
1800
|
field_labels?: Record<string, string>;
|
|
1204
1801
|
}
|
|
1802
|
+
/**
|
|
1803
|
+
* Fields and server-added state both list styles share. The configuration
|
|
1804
|
+
* fields hold what the author set; the JSON fields (`list_columns`, `list_sort`,
|
|
1805
|
+
* `list_controls`, `list_fixed_filter`, `quick_actions`) are JSON documents the
|
|
1806
|
+
* server validates when the section is saved or imported, so a renderer never
|
|
1807
|
+
* parses them: it draws `list_state`.
|
|
1808
|
+
*/
|
|
1809
|
+
interface IFormListBaseStyle extends IStyleWithSpacing {
|
|
1810
|
+
/**
|
|
1811
|
+
* The server-rendered state of the list for this visitor and URL, added by the
|
|
1812
|
+
* page endpoints after the page cache. Absent when {@link list_error} is set.
|
|
1813
|
+
*/
|
|
1814
|
+
list_state?: IFormListState;
|
|
1815
|
+
/** Why the list has no state (sign in, not allowed, invalid parameter, bad configuration). The page is still served. */
|
|
1816
|
+
list_error?: IFormListError;
|
|
1817
|
+
/** Optional auto-styled heading rendered above the list when set. */
|
|
1818
|
+
title?: IContentField<string>;
|
|
1819
|
+
/** The list's name in the URL (`<key>.page`, `<key>.q`, ...); unique on a page. */
|
|
1820
|
+
list_key?: IContentField<string>;
|
|
1821
|
+
/** Numeric `data_tables.id`, or empty: the table of the inline form. Required for a data view. */
|
|
1822
|
+
data_table?: IContentField<string>;
|
|
1823
|
+
list_layout?: IContentField<TFormListLayout>;
|
|
1824
|
+
/** Rows per page, 1 to 100. */
|
|
1825
|
+
page_size?: IContentField<string>;
|
|
1826
|
+
/** JSON: up to 30 columns `{field, label, sortable, searchable, format}`. */
|
|
1827
|
+
list_columns?: IContentField<string>;
|
|
1828
|
+
/** JSON: up to 3 default sort keys `{field, direction}`. */
|
|
1829
|
+
list_sort?: IContentField<string>;
|
|
1830
|
+
/** JSON: up to 12 visitor controls (search-adjacent filters). */
|
|
1831
|
+
list_controls?: IContentField<string>;
|
|
1832
|
+
/** JSON: the author's dataset filter; every read and write of the list honours it. */
|
|
1833
|
+
list_fixed_filter?: IContentField<string>;
|
|
1834
|
+
/** '1' (default on `entry-form-list`): the list shows and changes the visitor's own records only. */
|
|
1835
|
+
own_entries_only?: IContentField<string>;
|
|
1836
|
+
label_empty?: IContentField<string>;
|
|
1837
|
+
label_search?: IContentField<string>;
|
|
1838
|
+
}
|
|
1839
|
+
/**
|
|
1840
|
+
* Entry List with Form: a server-rendered list of records with create, view,
|
|
1841
|
+
* edit, delete and quick actions, over the generic data store. Its child
|
|
1842
|
+
* sections include the inline form that creates and edits records.
|
|
1843
|
+
*/
|
|
1844
|
+
interface IEntryFormListStyle extends IFormListBaseStyle {
|
|
1845
|
+
style_name: 'entry-form-list';
|
|
1846
|
+
form_presentation?: IContentField<TFormListPresentation>;
|
|
1847
|
+
/** JSON: up to 8 server-defined quick actions `{id, label, confirm, set, when}`. */
|
|
1848
|
+
quick_actions?: IContentField<string>;
|
|
1849
|
+
allow_create?: IContentField<string>;
|
|
1850
|
+
allow_update?: IContentField<string>;
|
|
1851
|
+
allow_delete?: IContentField<string>;
|
|
1852
|
+
/** '1' offers versions, comparison and restore of a record. */
|
|
1853
|
+
show_history?: IContentField<string>;
|
|
1854
|
+
label_add?: IContentField<string>;
|
|
1855
|
+
label_confirm_delete?: IContentField<string>;
|
|
1856
|
+
}
|
|
1857
|
+
/**
|
|
1858
|
+
* Data View: the read-only sibling of {@link IEntryFormListStyle}. It shows a
|
|
1859
|
+
* table, cards or your own layout of records and never writes; a forged write is
|
|
1860
|
+
* refused. With the `custom` layout its child sections are the template of ONE
|
|
1861
|
+
* record: the server renders them per record into `list_state.rows[].sections`, so
|
|
1862
|
+
* the page itself carries no children for it.
|
|
1863
|
+
*/
|
|
1864
|
+
interface IDataViewStyle extends IFormListBaseStyle {
|
|
1865
|
+
style_name: 'data-view';
|
|
1866
|
+
/** A site path containing `{record_id}` exactly once; a row links there. */
|
|
1867
|
+
detail_url?: IContentField<string>;
|
|
1868
|
+
/** Classes of the element that holds the records of the `custom` layout (for example a grid); web only. */
|
|
1869
|
+
list_row_css?: IContentField<string>;
|
|
1870
|
+
}
|
|
1205
1871
|
|
|
1206
1872
|
type TMantineAccordionMultiple = '0' | '1';
|
|
1207
1873
|
type TMantineAccordionChevronPosition = 'left' | 'right';
|
|
@@ -1308,10 +1974,23 @@ interface IEntryRecordStyle extends IBaseStyle {
|
|
|
1308
1974
|
* `/team-members/{record_id}`). The holder loads that single row.
|
|
1309
1975
|
*/
|
|
1310
1976
|
load_record_from?: IContentField<string>;
|
|
1977
|
+
/**
|
|
1978
|
+
* Typed JSON fixed filter (same shape as a list's `list_fixed_filter`).
|
|
1979
|
+
* Bounds which record this detail may show; a record outside it is treated
|
|
1980
|
+
* like a missing record (F166).
|
|
1981
|
+
*/
|
|
1982
|
+
fixed_filter?: IContentField<string>;
|
|
1311
1983
|
scope?: IContentField<string>;
|
|
1312
1984
|
}
|
|
1313
1985
|
interface IEntryRecordDeleteStyle extends IBaseStyle {
|
|
1314
1986
|
style_name: 'entry-record-delete';
|
|
1987
|
+
/** The record this button deletes: injected by the server from the enclosing record (not a CMS field). */
|
|
1988
|
+
record_id?: IContentField<string>;
|
|
1989
|
+
/**
|
|
1990
|
+
* The version that record has when the page is built, as digits (injected next to `record_id`;
|
|
1991
|
+
* absent when the record no longer exists). Send it back as `expected_version`.
|
|
1992
|
+
*/
|
|
1993
|
+
record_version?: IContentField<string>;
|
|
1315
1994
|
/** Delete button text (catalog field; the generic `label` field is not linked to this style). */
|
|
1316
1995
|
label_delete?: IContentField<string>;
|
|
1317
1996
|
confirmation_title?: IContentField<string>;
|
|
@@ -1361,13 +2040,64 @@ interface IMissingStyle extends IStyleWithSpacing {
|
|
|
1361
2040
|
show_icon?: IContentField<string>;
|
|
1362
2041
|
}
|
|
1363
2042
|
/**
|
|
1364
|
-
*
|
|
1365
|
-
*
|
|
1366
|
-
*
|
|
1367
|
-
*
|
|
2043
|
+
* One line of the "about the platform" block: a framework, a plugin or a
|
|
2044
|
+
* library. The same shape is used by the server lists, by the lists the web and
|
|
2045
|
+
* mobile builds generate for themselves, and by `GET /admin/system/version`.
|
|
2046
|
+
*
|
|
2047
|
+
* - `version` is `null` unless the caller may see exact versions
|
|
2048
|
+
* (`IPlatformAbout.detail`); then it is the exact version, or `null` when it
|
|
2049
|
+
* is unknown.
|
|
2050
|
+
* - `license` is an SPDX id or a short text, `null` when unknown. Several
|
|
2051
|
+
* licences are joined with ` OR `.
|
|
2052
|
+
*/
|
|
2053
|
+
interface IAboutItem {
|
|
2054
|
+
name: string;
|
|
2055
|
+
version: string | null;
|
|
2056
|
+
license: string | null;
|
|
2057
|
+
}
|
|
2058
|
+
/**
|
|
2059
|
+
* The server-filled "about the platform" block of a `version` section.
|
|
2060
|
+
*
|
|
2061
|
+
* The backend adds it after the page cache is read, on every request, because
|
|
2062
|
+
* `detail` depends on the caller: it is `true` only when the caller holds
|
|
2063
|
+
* `admin.system.read`. A client never decides this; it draws what it receives.
|
|
2064
|
+
*
|
|
2065
|
+
* - `product.version` (the SelfHelp version) is always set.
|
|
2066
|
+
* - `frameworks` are the server-side parts (PHP, Symfony, MySQL, Redis),
|
|
2067
|
+
* `plugins` the installed and enabled plugins, `libraries` the backend's
|
|
2068
|
+
* direct production dependencies.
|
|
2069
|
+
* - Lists are empty arrays, never missing. Every item's `version` is `null`
|
|
2070
|
+
* while `detail` is `false`.
|
|
2071
|
+
*
|
|
2072
|
+
* The web and mobile renderers add their own generated list (same
|
|
2073
|
+
* {@link IAboutItem} shape) and show its versions only when `detail` is `true`.
|
|
2074
|
+
*/
|
|
2075
|
+
interface IPlatformAbout {
|
|
2076
|
+
detail: boolean;
|
|
2077
|
+
product: {
|
|
2078
|
+
name: string;
|
|
2079
|
+
version: string;
|
|
2080
|
+
};
|
|
2081
|
+
frameworks: IAboutItem[];
|
|
2082
|
+
plugins: IAboutItem[];
|
|
2083
|
+
libraries: IAboutItem[];
|
|
2084
|
+
}
|
|
2085
|
+
/**
|
|
2086
|
+
* "About the platform" block. `about` is always present (filled by the backend
|
|
2087
|
+
* for every caller); the headings are translatable style fields so no client
|
|
2088
|
+
* hard-codes text.
|
|
1368
2089
|
*/
|
|
1369
2090
|
interface IVersionStyle extends IBaseStyle {
|
|
1370
2091
|
style_name: 'version';
|
|
2092
|
+
about: IPlatformAbout;
|
|
2093
|
+
title?: IContentField<string>;
|
|
2094
|
+
label_frameworks?: IContentField<string>;
|
|
2095
|
+
label_plugins?: IContentField<string>;
|
|
2096
|
+
label_libraries?: IContentField<string>;
|
|
2097
|
+
label_web?: IContentField<string>;
|
|
2098
|
+
label_app?: IContentField<string>;
|
|
2099
|
+
label_filter?: IContentField<string>;
|
|
2100
|
+
label_no_match?: IContentField<string>;
|
|
1371
2101
|
}
|
|
1372
2102
|
|
|
1373
2103
|
/**
|
|
@@ -1378,7 +2108,7 @@ interface IVersionStyle extends IBaseStyle {
|
|
|
1378
2108
|
* Admin/CMS-only styles are intentionally NOT in this union — the mobile
|
|
1379
2109
|
* app does not render them.
|
|
1380
2110
|
*/
|
|
1381
|
-
type TStyle = ILoginStyle | IRegisterStyle | IValidateStyle | IResetPasswordStyle | ITwoFactorAuthStyle | IProfileStyle | IContainerStyle | IBoxStyle | IFlexStyle | IGroupStyle | IStackStyle | ISimpleGridStyle | IGridStyle | IGridColumnStyle | ISpaceStyle | IDividerStyle | IPaperStyle | ICenterStyle | IScrollAreaStyle | ICardStyle | ICardSegmentStyle | IAspectRatioStyle | IBackgroundImageStyle | ITitleStyle | ITextStyle | ICodeStyle | IHighlightStyle | IBlockquoteStyle | IHtmlTagStyle | IKbdStyle | ITypographyStyle | IFieldsetStyle | ISpoilerStyle | IImageStyle | IVideoStyle | IAudioStyle | IFigureStyle | ICarouselStyle | IButtonStyle | ILinkStyle | IActionIconStyle | IAlertStyle | IBadgeStyle | IAvatarStyle | IChipStyle | IIndicatorStyle | IThemeIconStyle | INotificationStyle | IFormLogStyle | IFormRecordStyle | IInputStyle | ITextInputStyle | ITextareaStyle | IRichTextEditorStyle | ISelectStyle | IRadioStyle | ICheckboxStyle | ISliderStyle | IRangeSliderStyle | IDatePickerStyle | ISwitchStyle | IComboboxStyle | IColorInputStyle | IColorPickerStyle | IFileInputStyle | INumberInputStyle | ISegmentedControlStyle | IRatingStyle | IProgressStyle | IProgressRootStyle | IProgressSectionStyle | IAccordionStyle | IAccordionItemStyle | ITabsStyle | ITabStyle | ITimelineStyle | IListStyle | IListItemStyle | IEntryListStyle | IEntryRecordStyle | IEntryRecordDeleteStyle | ILoopStyle | ITimelineItemStyle | INoAccessStyle | INotFoundStyle | IMissingStyle | IVersionStyle | IRefContainerStyle | IDataContainerStyle | IEntryTableStyle;
|
|
2111
|
+
type TStyle = ILoginStyle | IRegisterStyle | IValidateStyle | IResetPasswordStyle | ITwoFactorAuthStyle | IProfileStyle | IContainerStyle | IBoxStyle | IFlexStyle | IGroupStyle | IStackStyle | ISimpleGridStyle | IGridStyle | IGridColumnStyle | ISpaceStyle | IDividerStyle | IPaperStyle | ICenterStyle | IScrollAreaStyle | ICardStyle | ICardSegmentStyle | IAspectRatioStyle | IBackgroundImageStyle | ITitleStyle | ITextStyle | ICodeStyle | IHighlightStyle | IBlockquoteStyle | IHtmlTagStyle | IKbdStyle | ITypographyStyle | IFieldsetStyle | ISpoilerStyle | IImageStyle | IVideoStyle | IAudioStyle | IFigureStyle | ICarouselStyle | IButtonStyle | ILinkStyle | IActionIconStyle | IAlertStyle | IBadgeStyle | IAvatarStyle | IChipStyle | IIndicatorStyle | IThemeIconStyle | INotificationStyle | IFormLogStyle | IFormRecordStyle | IInputStyle | ITextInputStyle | ITextareaStyle | IRichTextEditorStyle | ISelectStyle | IRadioStyle | ICheckboxStyle | ISliderStyle | IRangeSliderStyle | IDatePickerStyle | ISwitchStyle | IComboboxStyle | IColorInputStyle | IColorPickerStyle | IFileInputStyle | INumberInputStyle | ISegmentedControlStyle | IRatingStyle | IProgressStyle | IProgressRootStyle | IProgressSectionStyle | IAccordionStyle | IAccordionItemStyle | ITabsStyle | ITabStyle | ITimelineStyle | IListStyle | IListItemStyle | IEntryListStyle | IEntryRecordStyle | IEntryRecordDeleteStyle | ILoopStyle | ITimelineItemStyle | INoAccessStyle | INotFoundStyle | IMissingStyle | IVersionStyle | IRefContainerStyle | IDataContainerStyle | IEntryTableStyle | IEntryFormListStyle | IDataViewStyle;
|
|
1382
2112
|
/**
|
|
1383
2113
|
* Discriminator — name of every supported style. Derived from the
|
|
1384
2114
|
* `STYLE_REGISTRY` keys (declared in `src/registry/styles.registry.ts`).
|
|
@@ -2026,6 +2756,16 @@ declare const BASE_STYLE_REGISTRY: {
|
|
|
2026
2756
|
readonly category: "forms";
|
|
2027
2757
|
readonly canHaveChildren: false;
|
|
2028
2758
|
};
|
|
2759
|
+
readonly 'entry-form-list': {
|
|
2760
|
+
readonly description: "Entry list with form: server-rendered list of records with create / view / edit / delete, quick actions and history";
|
|
2761
|
+
readonly category: "forms";
|
|
2762
|
+
readonly canHaveChildren: true;
|
|
2763
|
+
};
|
|
2764
|
+
readonly 'data-view': {
|
|
2765
|
+
readonly description: "Read-only server-rendered table, cards or your own layout (sections placed inside, drawn once per record) of records of a data table";
|
|
2766
|
+
readonly category: "forms";
|
|
2767
|
+
readonly canHaveChildren: true;
|
|
2768
|
+
};
|
|
2029
2769
|
};
|
|
2030
2770
|
/**
|
|
2031
2771
|
* Backward-compatible alias for the core registry. Pre-plugin code
|
|
@@ -2489,6 +3229,16 @@ declare const STYLE_REGISTRY: {
|
|
|
2489
3229
|
readonly category: "forms";
|
|
2490
3230
|
readonly canHaveChildren: false;
|
|
2491
3231
|
};
|
|
3232
|
+
readonly 'entry-form-list': {
|
|
3233
|
+
readonly description: "Entry list with form: server-rendered list of records with create / view / edit / delete, quick actions and history";
|
|
3234
|
+
readonly category: "forms";
|
|
3235
|
+
readonly canHaveChildren: true;
|
|
3236
|
+
};
|
|
3237
|
+
readonly 'data-view': {
|
|
3238
|
+
readonly description: "Read-only server-rendered table, cards or your own layout (sections placed inside, drawn once per record) of records of a data table";
|
|
3239
|
+
readonly category: "forms";
|
|
3240
|
+
readonly canHaveChildren: true;
|
|
3241
|
+
};
|
|
2492
3242
|
};
|
|
2493
3243
|
type TStyleRegistryKey = keyof typeof BASE_STYLE_REGISTRY;
|
|
2494
3244
|
/**
|
|
@@ -2534,4 +3284,4 @@ declare function getPluginStyleRegistry(): Record<string, IPluginStyleRegistryEn
|
|
|
2534
3284
|
*/
|
|
2535
3285
|
declare function _resetPluginStyleRegistry(): void;
|
|
2536
3286
|
|
|
2537
|
-
export { type
|
|
3287
|
+
export { type IColorInputStyle as $, type IAdminDataRecordRestoreRequest as A, BASE_STYLE_REGISTRY as B, type IAdminDataRecordRestoreResponse as C, type IAdminDataRecordVersionResponse as D, type IAlertStyle as E, type IApiError as F, type IApiMeta as G, type IAspectRatioStyle as H, type IStyleRegistryEntry as I, type IAudioStyle as J, type IAvatarStyle as K, type IBackgroundImageStyle as L, type IBadgeStyle as M, type IBaseStyle as N, type IBlockquoteStyle as O, type IBoxStyle as P, type IButtonStyle as Q, type ICardSegmentStyle as R, STYLE_REGISTRY as S, type TStyleName as T, type ICardStyle as U, type ICarouselStyle as V, type ICenterStyle as W, type ICheckboxStyle as X, type IChipStyle as Y, type ICodeStyle as Z, type _AssertRegistryMatchesStyleName as _, type IPluginStyleRegistryEntry as a, type IFormLogStyle as a$, type IColorPickerStyle as a0, type IComboboxStyle as a1, type IContainerStyle as a2, type IDataContainerStyle as a3, type IDataViewStyle as a4, type IDatePickerStyle as a5, type IDividerStyle as a6, type IEntryFormListStyle as a7, type IEntryListStyle as a8, type IEntryRecordDeleteStyle as a9, type IFormListHistoricalFile as aA, type IFormListHistoryData as aB, type IFormListHistoryQuery as aC, type IFormListHistoryResponse as aD, type IFormListInfo as aE, type IFormListPagination as aF, type IFormListQuickActionData as aG, type IFormListQuickActionInfo as aH, type IFormListQuickActionRequest as aI, type IFormListQuickActionResponse as aJ, type IFormListRecordAccess as aK, type IFormListRestoreBlocker as aL, type IFormListRestoreChange as aM, type IFormListRestorePreview as aN, type IFormListRestoreRequest as aO, type IFormListRestoreResponse as aP, type IFormListRestoreResult as aQ, type IFormListRevision as aR, type IFormListRow as aS, type IFormListSelected as aT, type IFormListServedState as aU, type IFormListState as aV, type IFormListStateField as aW, type IFormListStateResponse as aX, type IFormListValueChange as aY, type IFormListVersionData as aZ, type IFormListVersionResponse as a_, type IEntryRecordFormStyle as aa, type IEntryRecordStyle as ab, type IEntryTableEntry as ac, type IEntryTableStyle as ad, type IFieldsetStyle as ae, type IFigureStyle as af, type IFileInputStyle as ag, type IFlexStyle as ah, type IFormDeleteData as ai, type IFormDeleteRequest as aj, type IFormDeleteResponse as ak, type IFormEffectiveContext as al, type IFormFileFieldOp as am, type IFormInputError as an, type IFormListActor as ao, type IFormListBaseStyle as ap, type IFormListCapabilities as aq, type IFormListColumn as ar, type IFormListCompareData as as, type IFormListCompareQuery as at, type IFormListCompareResponse as au, type IFormListControl as av, type IFormListControlOption as aw, type IFormListError as ax, type IFormListFileChange as ay, type IFormListFileValue as az, type TStylePlacement as b, type IUnknownStyle as b$, type IFormRecordStyle as b0, type IFormResultLegacyFields as b1, type IFormStyle as b2, type IFormSubmitData as b3, type IFormSubmitRequest as b4, type IFormSubmitResponse as b5, type IFormUpdateData as b6, type IFormUpdateRequest as b7, type IFormUpdateResponse as b8, type IGridColumnStyle as b9, type IRangeSliderStyle as bA, type IRatingStyle as bB, type IRefContainerStyle as bC, type IRegisterStyle as bD, type IResetPasswordStyle as bE, type IRichTextEditorStyle as bF, type IScrollAreaStyle as bG, type ISegmentedControlStyle as bH, type ISelectStyle as bI, type ISimpleGridStyle as bJ, type ISliderStyle as bK, type ISpaceStyle as bL, type ISpoilerStyle as bM, type IStackStyle as bN, type IStyleWithSpacing as bO, type ISwitchStyle as bP, type ITabStyle as bQ, type ITabsStyle as bR, type ITextInputStyle as bS, type ITextStyle as bT, type ITextareaStyle as bU, type IThemeIconStyle as bV, type ITimelineItemStyle as bW, type ITimelineStyle as bX, type ITitleStyle as bY, type ITwoFactorAuthStyle as bZ, type ITypographyStyle as b_, type IGridStyle as ba, type IGroupStyle as bb, type IHighlightStyle as bc, type IHtmlTagStyle as bd, type IImageStyle as be, type IIndicatorStyle as bf, type IInputStyle as bg, type IKbdStyle as bh, type ILinkStyle as bi, type IListItemStyle as bj, type IListStyle as bk, type ILoginStyle as bl, type ILoopStyle as bm, type IMeta as bn, type IMissingStyle as bo, type INoAccessStyle as bp, type INotFoundStyle as bq, type INotificationStyle as br, type INumberInputStyle as bs, type IPaperStyle as bt, type IPlatformAbout as bu, type IProfileStyle as bv, type IProgressRootStyle as bw, type IProgressSectionStyle as bx, type IProgressStyle as by, type IRadioStyle as bz, type TConcretePlatform as c, type TMantineTranslatable as c$, type IValidateStyle as c0, type IVersionStyle as c1, type IVideoStyle as c2, type TDataRevisionOperation as c3, type TDataRevisionSource as c4, type TFormConflictData as c5, type TFormInputRule as c6, type TFormListCellValue as c7, type TFormListChange as c8, type TFormListColumnFormat as c9, type TMantineIconSize as cA, type TMantineImageFit as cB, type TMantineLineClamp as cC, type TMantineListCenter as cD, type TMantineListStyleType as cE, type TMantineListType as cF, type TMantineListWithPadding as cG, type TMantinePaperShadow as cH, type TMantineProgressTransition as cI, type TMantineScrollAreaSize as cJ, type TMantineScrollAreaType as cK, type TMantineTextAlign as cL, type TMantineTextDecoration as cM, type TMantineTextFontStyle as cN, type TMantineTextFontWeight as cO, type TMantineTextInherit as cP, type TMantineTextInputVariant as cQ, type TMantineTextSpan as cR, type TMantineTextTransform as cS, type TMantineTextTruncate as cT, type TMantineTextVariant as cU, type TMantineTextareaAutosize as cV, type TMantineTextareaResize as cW, type TMantineTextareaVariant as cX, type TMantineTimelineAlign as cY, type TMantineTitleLineClamp as cZ, type TMantineTitleTextWrap as c_, type TFormListControlType as ca, type TFormListErrorReason as cb, type TFormListLabels as cc, type TFormListLayout as cd, type TFormListOpenMode as ce, type TFormListPresentation as cf, type TFormListRestoreBlockerReason as cg, type TFormListRestoreData as ch, type TFormListSortDirection as ci, type TFormListStyleName as cj, type TFormListTextMatch as ck, type TFormWriteRefusalReason as cl, type TMantineAccordionChevronPosition as cm, type TMantineAccordionDisableChevronRotation as cn, type TMantineAccordionLoop as co, type TMantineAccordionMultiple as cp, type TMantineAnchorUnderline as cq, type TMantineBorder as cr, type TMantineCardPadding as cs, type TMantineCardShadow as ct, type TMantineCols as cu, type TMantineDividerVariant as cv, type TMantineGap as cw, type TMantineGridOffset as cx, type TMantineGridOrder as cy, type TMantineHeight as cz, type TStylePlatform as d, type TMantineUseInputWrapper as d0, type TMantineWidth as d1, type TSharedBorder as d2, type TSharedCols as d3, type TSharedDimension as d4, type TSharedDividerLabelPosition as d5, type TSharedDividerVariant as d6, type TSharedLabelPosition as d7, type TStyle as d8, type TStyleRegistryKey as e, _resetPluginStyleRegistry as f, extendStyleRegistry as g, getMergedStyleRegistry as h, getPluginStyleRegistry as i, type IContentField as j, type IBaseApiResponse as k, type IAboutItem as l, type TMobileButtonFeedback as m, type TMobileFieldVariant as n, type TMobileSelectPresentation as o, type IFormInvalidData as p, type IFormListRestoreBlockedData as q, type IFormStaleVersionData as r, type IFormListFilesCell as s, type TFormListMode as t, type IFormListSort as u, type IAccordionItemStyle as v, type IAccordionStyle as w, type IActionIconStyle as x, type IAdminDataRecordCompareResponse as y, type IAdminDataRecordHistoryResponse as z };
|