@marianmeres/collection-types 2.6.0 → 2.9.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.
@@ -56,9 +56,14 @@ export interface CollectionDTOIn {
56
56
  is_deletable?: boolean;
57
57
  /** Whether collection is read-only */
58
58
  is_readonly?: boolean;
59
- /** Folder definitions */
60
- folders?: Record<string, FolderDefinition>;
61
- /** Tag definitions per model type */
59
+ /**
60
+ * Folder definitions per model type. Outer key is the model type (or the
61
+ * special `"__common__"` bucket applied to every type); inner key is the
62
+ * folder (ltree) label. Mirrors {@link tags}; this is the shape the server
63
+ * reads in `ServiceModel.findAllFolders` (`coll.folders["__common__" | type]`).
64
+ */
65
+ folders?: Record<string, Record<string, FolderDefinition>>;
66
+ /** Tag definitions per model type (outer key = model type / `"__common__"`). */
62
67
  tags?: Record<string, Record<string, TagDefinition>>;
63
68
  /** Ownership mode for models in this collection */
64
69
  owner_id_mode?: OwnerIdMode;
package/dist/order.d.ts CHANGED
@@ -53,16 +53,6 @@ export interface DeliveryOptionSnapshot {
53
53
  }
54
54
  /** Order data field schema */
55
55
  export interface OrderData {
56
- /**
57
- * Public, customer-facing order identifier shown in place of the model UUID
58
- * everywhere the customer is involved (checkout confirmation, emails, the
59
- * printed order document, account order history). Non-sequential Crockford
60
- * base32 (uppercase, length 6), generated and uniqueness-checked at creation,
61
- * then FROZEN — never changed on any subsequent update. Mirrors
62
- * `InvoiceData.code`. Optional so legacy/admin-created rows that predate the
63
- * field still type-check; read paths fall back to `shortOrderRef(model_id)`.
64
- */
65
- code?: string;
66
56
  /** Current order status */
67
57
  status: OrderStatus;
68
58
  /** Line items (snapshots) */
@@ -36,6 +36,14 @@ export type ObjectSchema<T> = {
36
36
  * last touched" in the list.
37
37
  */
38
38
  _data_table_dates?: ("_created_at" | "_updated_at")[];
39
+ /**
40
+ * Admin list-view hint: blacklist of always-on system columns to suppress in
41
+ * the DataTable (e.g. `["model_id"]` to hide the opaque UUID when the built-in
42
+ * human-friendly `code` column already identifies the row). Applied after the
43
+ * column list is assembled. Cosmetic only — row navigation reads `model_id`
44
+ * from the row, not the visible column.
45
+ */
46
+ _data_table_hidden_columns?: string[];
39
47
  };
40
48
  /** Extended schema (loose typing for __extends patterns) */
41
49
  export type ExtendedSchema = {
package/dist/schema.d.ts CHANGED
@@ -5,6 +5,19 @@
5
5
  import type { MaybeLocalized } from "./utils.js";
6
6
  /** HTML field type for UI rendering */
7
7
  export type SchemaHtmlType = "text" | "textarea" | "wysiwyg" | "markdown" | "number" | "money" | "boolean" | "checkbox" | "parent" | "object" | "select" | "status" | "multiselect" | "date" | "datetime" | "time" | "color" | "relation" | "asset" | "json" | "code" | "keyvalues" | "password" | "user";
8
+ /**
9
+ * A markdown-editor toolbar button key, or `"|"` for a visual separator. Mirrors
10
+ * stuic's `MarkdownEditor` `ToolbarItem` union (kept local so this shared package
11
+ * stays free of a stuic dependency). Unknown keys are ignored by the editor.
12
+ */
13
+ export type MarkdownToolbarItem = "bold" | "italic" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "link" | "image" | "bulletList" | "orderedList" | "blockquote" | "codeBlock" | "hr" | "hardBreak" | "undo" | "redo" | "|";
14
+ /**
15
+ * The markdown editor's active editing surface. Mirrors stuic's `MarkdownEditor`
16
+ * `MarkdownEditorMode` union (kept local so this shared package stays free of a
17
+ * stuic dependency). `"wysiwyg"` = the quasi-WYSIWYG (Milkdown) surface;
18
+ * `"source"` = the raw-markdown (CodeMirror) surface.
19
+ */
20
+ export type MarkdownEditorMode = "wysiwyg" | "source";
8
21
  /** Configuration for relation-type fields in schema */
9
22
  export interface RelationTypeConfig {
10
23
  relation_type: string;
@@ -37,6 +50,11 @@ export interface SelectConfig {
37
50
  intent?: string;
38
51
  }>;
39
52
  multiple?: boolean;
53
+ /** `multiselect` only: when true the picker accepts free-text values not in
54
+ * `options` (the listed options become suggestions, not a closed set). Use
55
+ * for fields like account `roles` where the value set is intentionally open
56
+ * server-side. Default false (a true closed enum). */
57
+ allowUnknown?: boolean;
40
58
  }
41
59
  /** Configuration for keyvalues fields */
42
60
  export interface KeyValuesConfig {
@@ -87,6 +105,35 @@ export interface SchemaHtmlConfig {
87
105
  _data_table_order?: number;
88
106
  /** Number of textarea rows */
89
107
  rows?: number;
108
+ /**
109
+ * Markdown editor resting-height floor (CSS length string or px number).
110
+ * Funneled into `--stuic-markdown-editor-min-height`. Lower it for compact
111
+ * fields (e.g. a description in a drawer) so the editor doesn't dominate.
112
+ */
113
+ minHeight?: number | string;
114
+ /** Markdown editor height cap (CSS length string or px number). */
115
+ maxHeight?: number | string;
116
+ /**
117
+ * Markdown editor toolbar. An ordered array picks exactly which buttons show
118
+ * (use `"|"` for separators); `[]` hides all formatting buttons (the
119
+ * Source/Preview toggle still shows). NOTE: `false` is dropped by joy's field
120
+ * cleanup, so use `[]` to hide — not `false`.
121
+ */
122
+ toolbar?: boolean | MarkdownToolbarItem[];
123
+ /**
124
+ * Toolbar shown on mobile / touch devices (the editor ignores `toolbar`
125
+ * there). Set this too if a custom `toolbar` must also apply on mobile.
126
+ */
127
+ mobileToolbar?: boolean | MarkdownToolbarItem[];
128
+ /**
129
+ * Markdown editor INITIAL editing surface (default `"wysiwyg"`). Set
130
+ * `"source"` to mount in the raw-markdown surface instead. Only the initial
131
+ * surface — the Source/Preview toggle still lets the user switch, and the
132
+ * choice sticks (joy forwards this one-way to MarkdownEditor's bindable
133
+ * `mode`, so nothing resets it on re-render). Note: on mobile/touch the
134
+ * editor already starts in source regardless (`autoSourceOnMobile`).
135
+ */
136
+ mode?: MarkdownEditorMode;
90
137
  /** Input placeholder text */
91
138
  placeholder?: string;
92
139
  /** Help text */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/collection-types",
3
- "version": "2.6.0",
3
+ "version": "2.9.0",
4
4
  "type": "module",
5
5
  "main": "dist/mod.js",
6
6
  "types": "dist/mod.d.ts",