@protobase/layout 0.18.0 → 0.19.1

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
@@ -2,10 +2,11 @@ import { Block, LayoutChild, LayoutChildren, LayoutNode, LayoutValue, isLayoutNo
2
2
  import { Action, ActionProps, ButtonVariant, Card, CardProps, CardRow, CardRowProps, DataProps, Elements, Field, FieldProps, Grid, GridProps, GridSpan, Link, LinkProps, ModalForm, ModalFormProps, Page, PageProps, Progress, ProgressProps, RecordCard, RecordCardProps, RecordRow, RecordRowProps, Show, ShowProps, Stat, StatProps, Table, TableProps } from "./blocks.js";
3
3
  import { ComponentOptions, component } from "./component.js";
4
4
  import { PageDefinition, PageModel, PageOptions, isPageDefinition, page } from "./page.js";
5
+ import { Location, walkTree } from "./walk.js";
5
6
  import { checkPages } from "./check-page.js";
6
7
  import { prunePage } from "./prune-page.js";
7
8
  import { countedResource, evaluateCondition, parseCondition } from "./condition.js";
8
9
  import { PathStep, resolveFieldPath } from "./field-path.js";
9
10
  import { jsx_runtime_d_exports } from "./jsx-runtime.js";
10
11
  import { FieldRefValue, fieldRef } from "@protobase/schema";
11
- export { Action, type ActionProps, type Block, type ButtonVariant, Card, type CardProps, CardRow, type CardRowProps, type ComponentOptions, type DataProps, type Elements, Field, type FieldProps, type FieldRefValue, Grid, type GridProps, type GridSpan, type LayoutChild, type LayoutChildren, type LayoutNode, type LayoutValue, Link, type LinkProps, ModalForm, type ModalFormProps, Page, type PageDefinition, type PageModel, type PageOptions, type PageProps, type PathStep, Progress, type ProgressProps, RecordCard, type RecordCardProps, RecordRow, type RecordRowProps, Show, type ShowProps, Stat, type StatProps, Table, type TableProps, checkPages, component, countedResource, evaluateCondition, fieldRef, isLayoutNode, isPageDefinition, jsx_runtime_d_exports as jsxRuntime, page, parseCondition, prunePage, resolveFieldPath };
12
+ export { Action, type ActionProps, type Block, type ButtonVariant, Card, type CardProps, CardRow, type CardRowProps, type ComponentOptions, type DataProps, type Elements, Field, type FieldProps, type FieldRefValue, Grid, type GridProps, type GridSpan, type LayoutChild, type LayoutChildren, type LayoutNode, type LayoutValue, Link, type LinkProps, type Location, ModalForm, type ModalFormProps, Page, type PageDefinition, type PageModel, type PageOptions, type PageProps, type PathStep, Progress, type ProgressProps, RecordCard, type RecordCardProps, RecordRow, type RecordRowProps, Show, type ShowProps, Stat, type StatProps, Table, type TableProps, checkPages, component, countedResource, evaluateCondition, fieldRef, isLayoutNode, isPageDefinition, jsx_runtime_d_exports as jsxRuntime, page, parseCondition, prunePage, resolveFieldPath, walkTree };
package/dist/index.js CHANGED
@@ -2,10 +2,11 @@ import { isLayoutNode } from "./node.js";
2
2
  import { Action, Card, CardRow, Field, Grid, Link, ModalForm, Page, Progress, RecordCard, RecordRow, Show, Stat, Table } from "./blocks.js";
3
3
  import { component } from "./component.js";
4
4
  import { countedResource, evaluateCondition, parseCondition } from "./condition.js";
5
+ import { walkTree } from "./walk.js";
5
6
  import { isPageDefinition, page } from "./page.js";
6
7
  import { resolveFieldPath } from "./field-path.js";
7
8
  import { checkPages } from "./check-page.js";
8
9
  import { prunePage } from "./prune-page.js";
9
10
  import { jsx_runtime_exports } from "./jsx-runtime.js";
10
11
  import { fieldRef } from "@protobase/schema";
11
- export { Action, Card, CardRow, Field, Grid, Link, ModalForm, Page, Progress, RecordCard, RecordRow, Show, Stat, Table, checkPages, component, countedResource, evaluateCondition, fieldRef, isLayoutNode, isPageDefinition, jsx_runtime_exports as jsxRuntime, page, parseCondition, prunePage, resolveFieldPath };
12
+ export { Action, Card, CardRow, Field, Grid, Link, ModalForm, Page, Progress, RecordCard, RecordRow, Show, Stat, Table, checkPages, component, countedResource, evaluateCondition, fieldRef, isLayoutNode, isPageDefinition, jsx_runtime_exports as jsxRuntime, page, parseCondition, prunePage, resolveFieldPath, walkTree };
package/dist/walk.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { LayoutNode } from "./node.js";
2
+ //#region src/walk.d.ts
3
+ /** Where an element sits: inside a record (a `RecordCard`, or one card of a `CardRow`) of `resource`, or not. */
4
+ export type Scope = {
5
+ resource?: string;
6
+ record: boolean;
7
+ };
8
+ export type Location = {
9
+ path: string;
10
+ scope: Scope;
11
+ };
12
+ /** Calls `visit` for every element, parents first. */
13
+ export declare const walkTree: (node: LayoutNode, visit: (node: LayoutNode, at: Location) => void, at?: Location) => void;
14
+ //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/layout",
3
- "version": "0.18.0",
3
+ "version": "0.19.1",
4
4
  "description": "Composed pages for Protobase, written as JSX that compiles to plain data, with its JSX runtime.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -31,7 +31,7 @@
31
31
  "access": "public"
32
32
  },
33
33
  "dependencies": {
34
- "@protobase/schema": "0.18.0",
34
+ "@protobase/schema": "0.19.1",
35
35
  "aip-parsers": "^1.0.0"
36
36
  }
37
37
  }