@stonecrop/stonecrop 0.45.0 → 0.46.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.
@@ -506,10 +506,8 @@ export declare class Doctype {
506
506
  allowedStates?: string[];
507
507
  } | undefined;
508
508
  /**
509
- * Converts the registered doctype string to a slug (kebab-case). The following conversions are made:
510
- * - It replaces camelCase and PascalCase with kebab-case strings
511
- * - It replaces spaces and underscores with hyphens
512
- * - It converts the string to lowercase
509
+ * Converts the registered doctype string to a slug (kebab-case): camelCase and PascalCase become
510
+ * kebab-case, spaces and underscores become hyphens, and the result is lowercased.
513
511
  *
514
512
  * @returns The slugified doctype string
515
513
  *
@@ -1523,11 +1521,17 @@ export declare class Registry {
1523
1521
  * Resolve a Doctype's authoring schema into a rendered schema array suitable for AForm.
1524
1522
  *
1525
1523
  * Transforms `DoctypeField[]` (authoring space) → `ResolvedField[]` (rendering space):
1524
+ *
1526
1525
  * - `kind: 'field'` (not Link) → `ResolvedScalar`
1526
+ *
1527
1527
  * - `kind: 'field'` (Link, no declaration) → `ResolvedScalar` with `component: 'AFormLink'`
1528
+ *
1528
1529
  * - `kind: 'field'` (Link, `noneOrMany`/`atLeastOne`) → `ResolvedTable`
1530
+ *
1529
1531
  * - `kind: 'field'` (Link, `one`/`atMostOne`) → `ResolvedLink`
1532
+ *
1530
1533
  * - `kind: 'fieldset'` → `ResolvedFieldset` (children resolved recursively)
1534
+ *
1531
1535
  * - `kind: 'table'` → `ResolvedTable` (columns as `ColumnSchema[]`)
1532
1536
  *
1533
1537
  * Circular references are protected against via the `visited` set.
@@ -1540,8 +1544,7 @@ export declare class Registry {
1540
1544
  */
1541
1545
  resolveSchema(doctype: Doctype, visited?: Set<string>): ResolvedField[];
1542
1546
  /**
1543
- * Recursively resolve a `DoctypeField[]` using the provided link context.
1544
- * Called by `resolveSchema` and recursively for fieldset children.
1547
+ * Recursively resolve a `DoctypeField[]`, fieldset children included, using the provided link context.
1545
1548
  * @internal
1546
1549
  */
1547
1550
  private resolveFields;
@@ -1557,11 +1560,14 @@ export declare class Registry {
1557
1560
  * Narrows by `kind` discriminator for precise branch selection.
1558
1561
  *
1559
1562
  * - `kind: 'table'` → `[]`
1563
+ *
1560
1564
  * - `kind: 'link'` → the embedded record, built the same way
1565
+ *
1561
1566
  * - `kind: 'fieldset'` → its children, at the top level of the record: a fieldset is layout
1567
+ *
1562
1568
  * - `kind: 'field'` → no key at all
1563
1569
  *
1564
- * Starting values are the doctype's `defaults` and the app's, which `composeNewRecord` lays over this.
1570
+ * Starting values (the doctype's `defaults` and the app's) are laid over this.
1565
1571
  *
1566
1572
  * @param schema - The resolved schema array to derive the record from
1567
1573
  * @returns A plain object holding each table and embedded record, and no field values
@@ -2334,13 +2340,11 @@ export declare interface UndoRedoState {
2334
2340
 
2335
2341
  /**
2336
2342
  * Shared executor for doctype action clicks. A host's Desktop `@action` handler delegates
2337
- * here so every host runs the same logic from one definition:
2343
+ * here so every host runs the same logic from one definition.
2338
2344
  *
2339
- * - If the clicked action carries a `clientHandler`, run it. The handler **owns
2340
- * orchestration** — it calls `runAction` itself when it needs the server, navigates via
2341
- * `router`, reads `record`, or queries `graphql`. It supersedes the default dispatch.
2342
- * - Otherwise dispatch the action to its server `handler` (the pre-existing behavior),
2343
- * so actions without a `clientHandler` are unchanged.
2345
+ * If the clicked action carries a `clientHandler`, it runs and **owns orchestration**: it calls
2346
+ * `runAction` itself when it needs the server, navigates via `router`, reads `record`, or queries
2347
+ * `graphql`, in place of the default dispatch. Otherwise the action is dispatched to the server.
2344
2348
  *
2345
2349
  * `runAction` is the only blessed write: it dispatches **and** leaves the store consistent,
2346
2350
  * filing the returned record under the identity the *server* settled on and following the route
@@ -2409,15 +2413,23 @@ export declare interface UseClientActionOptions {
2409
2413
  * Get the lazy link state for a specific link field on a doctype record.
2410
2414
  *
2411
2415
  * This composable provides reactive state for lazy-loaded links:
2416
+ *
2412
2417
  * - `loading`: true while fetching
2418
+ *
2413
2419
  * - `loaded`: true after successful fetch (permanent until reload)
2420
+ *
2414
2421
  * - `error`: error state if any
2422
+ *
2415
2423
  * - `reload()`: explicitly trigger a fetch
2424
+ *
2416
2425
  * - `data`: computed from HST, or undefined if not loaded
2417
2426
  *
2418
2427
  * The reload() function respects the link's fetch strategy:
2428
+ *
2419
2429
  * - `sync`: fetches via GraphQL query through fetchNestedData
2430
+ *
2420
2431
  * - `lazy`: fetches via GraphQL query through fetchNestedData
2432
+ *
2421
2433
  * - `custom`: invokes the serialized handler function directly
2422
2434
  *
2423
2435
  * @param doctype - The doctype instance
@@ -2845,8 +2857,8 @@ export declare function useUndoRedoShortcuts(hstStore: HSTNode, enabled?: boolea
2845
2857
  * corrected value clears its stale error without disturbing other triggers.
2846
2858
  *
2847
2859
  * The engine is **advisory** and does **no rollback** — an invalid value stays in the record so the
2848
- * user can fix it; validity is reported separately via `isValid` (read by the save gate) and
2849
- * the per-field messages are surfaced via `errorsByField` / `errorsFor` for display.
2860
+ * user can fix it; validity is reported separately via `isValid`, and the per-field messages are
2861
+ * surfaced via `errorsByField` / `errorsFor` for display.
2850
2862
  *
2851
2863
  * @public
2852
2864
  */
package/dist/stonecrop.js CHANGED
@@ -2095,13 +2095,11 @@ function notifyActionError(failure) {
2095
2095
  }
2096
2096
  /**
2097
2097
  * Shared executor for doctype action clicks. A host's Desktop `@action` handler delegates
2098
- * here so every host runs the same logic from one definition:
2098
+ * here so every host runs the same logic from one definition.
2099
2099
  *
2100
- * - If the clicked action carries a `clientHandler`, run it. The handler **owns
2101
- * orchestration** — it calls `runAction` itself when it needs the server, navigates via
2102
- * `router`, reads `record`, or queries `graphql`. It supersedes the default dispatch.
2103
- * - Otherwise dispatch the action to its server `handler` (the pre-existing behavior),
2104
- * so actions without a `clientHandler` are unchanged.
2100
+ * If the clicked action carries a `clientHandler`, it runs and **owns orchestration**: it calls
2101
+ * `runAction` itself when it needs the server, navigates via `router`, reads `record`, or queries
2102
+ * `graphql`, in place of the default dispatch. Otherwise the action is dispatched to the server.
2105
2103
  *
2106
2104
  * `runAction` is the only blessed write: it dispatches **and** leaves the store consistent,
2107
2105
  * filing the returned record under the identity the *server* settled on and following the route
@@ -2224,15 +2222,23 @@ function useClientAction(options = {}) {
2224
2222
  * Get the lazy link state for a specific link field on a doctype record.
2225
2223
  *
2226
2224
  * This composable provides reactive state for lazy-loaded links:
2225
+ *
2227
2226
  * - `loading`: true while fetching
2227
+ *
2228
2228
  * - `loaded`: true after successful fetch (permanent until reload)
2229
+ *
2229
2230
  * - `error`: error state if any
2231
+ *
2230
2232
  * - `reload()`: explicitly trigger a fetch
2233
+ *
2231
2234
  * - `data`: computed from HST, or undefined if not loaded
2232
2235
  *
2233
2236
  * The reload() function respects the link's fetch strategy:
2237
+ *
2234
2238
  * - `sync`: fetches via GraphQL query through fetchNestedData
2239
+ *
2235
2240
  * - `lazy`: fetches via GraphQL query through fetchNestedData
2241
+ *
2236
2242
  * - `custom`: invokes the serialized handler function directly
2237
2243
  *
2238
2244
  * @param doctype - The doctype instance
@@ -2785,10 +2791,8 @@ var Doctype = class Doctype {
2785
2791
  return workflow.actions?.[actionName];
2786
2792
  }
2787
2793
  /**
2788
- * Converts the registered doctype string to a slug (kebab-case). The following conversions are made:
2789
- * - It replaces camelCase and PascalCase with kebab-case strings
2790
- * - It replaces spaces and underscores with hyphens
2791
- * - It converts the string to lowercase
2794
+ * Converts the registered doctype string to a slug (kebab-case): camelCase and PascalCase become
2795
+ * kebab-case, spaces and underscores become hyphens, and the result is lowercased.
2792
2796
  *
2793
2797
  * @returns The slugified doctype string
2794
2798
  *
@@ -3188,11 +3192,17 @@ var Registry = class Registry {
3188
3192
  * Resolve a Doctype's authoring schema into a rendered schema array suitable for AForm.
3189
3193
  *
3190
3194
  * Transforms `DoctypeField[]` (authoring space) → `ResolvedField[]` (rendering space):
3195
+ *
3191
3196
  * - `kind: 'field'` (not Link) → `ResolvedScalar`
3197
+ *
3192
3198
  * - `kind: 'field'` (Link, no declaration) → `ResolvedScalar` with `component: 'AFormLink'`
3199
+ *
3193
3200
  * - `kind: 'field'` (Link, `noneOrMany`/`atLeastOne`) → `ResolvedTable`
3201
+ *
3194
3202
  * - `kind: 'field'` (Link, `one`/`atMostOne`) → `ResolvedLink`
3203
+ *
3195
3204
  * - `kind: 'fieldset'` → `ResolvedFieldset` (children resolved recursively)
3205
+ *
3196
3206
  * - `kind: 'table'` → `ResolvedTable` (columns as `ColumnSchema[]`)
3197
3207
  *
3198
3208
  * Circular references are protected against via the `visited` set.
@@ -3214,8 +3224,7 @@ var Registry = class Registry {
3214
3224
  return result;
3215
3225
  }
3216
3226
  /**
3217
- * Recursively resolve a `DoctypeField[]` using the provided link context.
3218
- * Called by `resolveSchema` and recursively for fieldset children.
3227
+ * Recursively resolve a `DoctypeField[]`, fieldset children included, using the provided link context.
3219
3228
  * @internal
3220
3229
  */
3221
3230
  resolveFields(fields, links, visited) {
@@ -3305,11 +3314,14 @@ var Registry = class Registry {
3305
3314
  * Narrows by `kind` discriminator for precise branch selection.
3306
3315
  *
3307
3316
  * - `kind: 'table'` → `[]`
3317
+ *
3308
3318
  * - `kind: 'link'` → the embedded record, built the same way
3319
+ *
3309
3320
  * - `kind: 'fieldset'` → its children, at the top level of the record: a fieldset is layout
3321
+ *
3310
3322
  * - `kind: 'field'` → no key at all
3311
3323
  *
3312
- * Starting values are the doctype's `defaults` and the app's, which `composeNewRecord` lays over this.
3324
+ * Starting values (the doctype's `defaults` and the app's) are laid over this.
3313
3325
  *
3314
3326
  * @param schema - The resolved schema array to derive the record from
3315
3327
  * @returns A plain object holding each table and embedded record, and no field values
@@ -3510,8 +3522,8 @@ var plugin = { install: (app, options) => {
3510
3522
  * corrected value clears its stale error without disturbing other triggers.
3511
3523
  *
3512
3524
  * The engine is **advisory** and does **no rollback** — an invalid value stays in the record so the
3513
- * user can fix it; validity is reported separately via `isValid` (read by the save gate) and
3514
- * the per-field messages are surfaced via `errorsByField` / `errorsFor` for display.
3525
+ * user can fix it; validity is reported separately via `isValid`, and the per-field messages are
3526
+ * surfaced via `errorsByField` / `errorsFor` for display.
3515
3527
  *
3516
3528
  * @public
3517
3529
  */