@marianmeres/collection-types 2.5.0 → 2.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.
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) */
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;
@@ -63,12 +76,18 @@ export interface MoneyConfig {
63
76
  /** Optional ISO currency code, for surfaces that render a symbol (e.g. "USD"). */
64
77
  currency?: string;
65
78
  }
79
+ /** Configuration for `textarea` fields (`_html.type: "textarea"`). */
80
+ export interface TextareaConfig {
81
+ /** Visible row count. Absent → the compact, input-like default (1 row). A
82
+ * higher value makes the field read as a textarea (e.g. a description). */
83
+ rows?: number;
84
+ }
66
85
  /** Configuration for _html schema keyword */
67
86
  export interface SchemaHtmlConfig {
68
87
  /** Field type for UI rendering */
69
88
  type?: SchemaHtmlType;
70
89
  /** Type-specific configuration */
71
- _type_config?: RelationTypeConfig | AssetTypeConfig | SelectConfig | KeyValuesConfig | MoneyConfig;
90
+ _type_config?: RelationTypeConfig | AssetTypeConfig | SelectConfig | KeyValuesConfig | MoneyConfig | TextareaConfig;
72
91
  /** Display label (can be localized) */
73
92
  label?: MaybeLocalized<string>;
74
93
  /** Display description (can be localized) */
@@ -81,6 +100,35 @@ export interface SchemaHtmlConfig {
81
100
  _data_table_order?: number;
82
101
  /** Number of textarea rows */
83
102
  rows?: number;
103
+ /**
104
+ * Markdown editor resting-height floor (CSS length string or px number).
105
+ * Funneled into `--stuic-markdown-editor-min-height`. Lower it for compact
106
+ * fields (e.g. a description in a drawer) so the editor doesn't dominate.
107
+ */
108
+ minHeight?: number | string;
109
+ /** Markdown editor height cap (CSS length string or px number). */
110
+ maxHeight?: number | string;
111
+ /**
112
+ * Markdown editor toolbar. An ordered array picks exactly which buttons show
113
+ * (use `"|"` for separators); `[]` hides all formatting buttons (the
114
+ * Source/Preview toggle still shows). NOTE: `false` is dropped by joy's field
115
+ * cleanup, so use `[]` to hide — not `false`.
116
+ */
117
+ toolbar?: boolean | MarkdownToolbarItem[];
118
+ /**
119
+ * Toolbar shown on mobile / touch devices (the editor ignores `toolbar`
120
+ * there). Set this too if a custom `toolbar` must also apply on mobile.
121
+ */
122
+ mobileToolbar?: boolean | MarkdownToolbarItem[];
123
+ /**
124
+ * Markdown editor INITIAL editing surface (default `"wysiwyg"`). Set
125
+ * `"source"` to mount in the raw-markdown surface instead. Only the initial
126
+ * surface — the Source/Preview toggle still lets the user switch, and the
127
+ * choice sticks (joy forwards this one-way to MarkdownEditor's bindable
128
+ * `mode`, so nothing resets it on re-render). Note: on mobile/touch the
129
+ * editor already starts in source regardless (`autoSourceOnMobile`).
130
+ */
131
+ mode?: MarkdownEditorMode;
84
132
  /** Input placeholder text */
85
133
  placeholder?: string;
86
134
  /** Help text */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/collection-types",
3
- "version": "2.5.0",
3
+ "version": "2.8.0",
4
4
  "type": "module",
5
5
  "main": "dist/mod.js",
6
6
  "types": "dist/mod.d.ts",