@nivaro/react 0.1.300 → 0.1.301

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/index.d.ts CHANGED
@@ -413,6 +413,8 @@ export declare function BroadcastView({ className }: {
413
413
  className?: string;
414
414
  }): JSX.Element;
415
415
 
416
+ export declare function buildCopyAs(input: CopyAsInput): CopyAsSnippets;
417
+
416
418
  export declare function buildGroups<T extends QueueGroupingRow>(rows: T[], attribute: string): QueueGroup<T>[];
417
419
 
418
420
  export declare function BulkActionButtons({ targets, enabledKeys, tone, disabled, onDone }: {
@@ -1010,10 +1012,44 @@ export declare type ComponentOverrides = {
1010
1012
  fallback?: default_2.ComponentType<FieldComponentProps>;
1011
1013
  };
1012
1014
 
1015
+ /** The browser's conditions as the filter object the SDK and GraphQL take:
1016
+ * a dotted path folds into nested objects, an `or` group into `_or`, and
1017
+ * several conditions AND together. */
1018
+ export declare function conditionsToFilter(conditions: string | undefined): Record<string, unknown> | null;
1019
+
1013
1020
  export declare function ConformanceView({ className }: {
1014
1021
  className?: string;
1015
1022
  }): JSX.Element;
1016
1023
 
1024
+ /**
1025
+ * "Copy as …" (#654): the request behind a list or a record, as a curl
1026
+ * command, an SDK call and a GraphQL document, each ready to paste. The
1027
+ * token is always the `NIVARO_TOKEN` placeholder, never the viewer's own.
1028
+ */
1029
+ export declare function CopyAsButton({ collection, itemId, list, fields, compact, className }: Omit<CopyAsInput, 'origin'> & {
1030
+ /** Icon-only, borderless — for the record header's tool group. */
1031
+ compact?: boolean;
1032
+ className?: string;
1033
+ }): JSX.Element;
1034
+
1035
+ declare interface CopyAsInput {
1036
+ /** The host the API is served from, no trailing slash. */
1037
+ origin: string;
1038
+ collection: string;
1039
+ /** A record id renders the single-record forms. */
1040
+ itemId?: string | null;
1041
+ list?: ListRequest;
1042
+ /** Plain or dotted field keys the GraphQL selection lists (`id` is always
1043
+ * first; a key that starts with `__` is a synthetic column and skipped). */
1044
+ fields?: string[];
1045
+ }
1046
+
1047
+ declare interface CopyAsSnippets {
1048
+ curl: string;
1049
+ sdk: string;
1050
+ graphql: string;
1051
+ }
1052
+
1017
1053
  /**
1018
1054
  * `opts.open` is the gate's state AT CONSTRUCTION. A host that starts a
1019
1055
  * hidden tab must pass `false` here rather than calling `setOpen(false)`
@@ -3259,6 +3295,24 @@ export declare interface LeaderSocketHandle {
3259
3295
 
3260
3296
  export declare function listFieldInterfaces(): string[];
3261
3297
 
3298
+ /**
3299
+ * "Copy as …" (#654): the request a list or record view is making, rendered
3300
+ * as a curl command, an SDK call and a GraphQL document. Pure — no client,
3301
+ * no DOM — so the three renderings can be judged against each other.
3302
+ *
3303
+ * The token is never the real one: every rendering names `NIVARO_TOKEN`.
3304
+ */
3305
+ declare interface ListRequest {
3306
+ /** The browser's `conditions` JSON (an array of {path, op, value} and
3307
+ * `{or: [...]}` groups), already serialised. */
3308
+ conditions?: string;
3309
+ search?: string;
3310
+ /** Comma-joined sort, `-` prefix = descending. */
3311
+ sort?: string;
3312
+ limit?: number;
3313
+ page?: number;
3314
+ }
3315
+
3262
3316
  declare interface LockHolder {
3263
3317
  locked_by: string;
3264
3318
  locked_by_name: string | null;