Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .changeset/5867-plaintext-fenced-ts-batch4.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
---
---

Docs only, publishes nothing: nineteen TypeScript snippets across
`content/docs/blocks/block-schema.mdx` and six `content/docs/plugins/*.mdx`
reference pages were fenced ```plaintext, so `check-doc-snippet-types` — which
reads only `ts` / `tsx` fences — never saw them (objectui#5867, batch 4 of N).
Triage's classifier is the one applied: a plaintext block whose first line
starts with `import` / `export` / `interface` / `type X =` / `const x: T` is
code, and those fences are now `ts`; genuinely prose blocks on the same pages
are left alone. Compiling them found real documentation defects on
`block-schema`, now fixed: the *Complete Example*, *Block Slots* and
*Marketplace Example* blocks annotated `BlockSchema` / `SchemaNode` /
`BlockLibrarySchema` without importing them, and three blocks referenced values
defined in other blocks on the page. Resolving `BlockLibrarySchema` then
un-masked a defect the unresolved name had been suppressing: both marketplace
listings carried `schema: { /* block schema */ }`, an empty object that
`BlockLibraryItem.schema` rejects because `BlockSchema` requires `type`. The
gate's blocks-to-compile count rises from 206 to 225 — exactly the batch — with
diagnostics at 0, no new `FRAGMENT_MARKER` declarations, and the
covered/ungated sets unmoved. The blocks also stop rendering as unstyled
plaintext and pick up TypeScript highlighting, which is the reader-visible half.
43 changes: 29 additions & 14 deletions content/docs/blocks/block-schema.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ expanded. None of them goes through `BlockSchema`: there is nothing that expands

## Basic Usage

```plaintext
```ts
import type { BlockSchema } from '@object-ui/types';

const heroBlock: BlockSchema = {
Expand DownExpand Up@@ -108,7 +108,7 @@ const heroBlock: BlockSchema = {

### Block Metadata

```plaintext
```ts
interface BlockMetadata {
name: string; // Block identifier
label?: string; // Display name
Expand All@@ -129,7 +129,7 @@ interface BlockMetadata {

Variables define configurable properties:

```plaintext
```ts
interface BlockVariable {
name: string; // Variable name
label?: string; // Display label
Expand All@@ -146,7 +146,9 @@ interface BlockVariable {

Slots define content injection points:

```plaintext
```ts
import type { SchemaNode } from '@object-ui/types';

interface BlockSlot {
name: string; // Slot name
label?: string; // Display label
Expand DownExpand Up@@ -186,7 +188,9 @@ this family it is **declared but not yet consumed** - no renderer reads it today

## Complete Example

```plaintext
```ts
import type { BlockSchema } from '@object-ui/types';

const cardBlock: BlockSchema = {
type: 'block',

Expand DownExpand Up@@ -325,7 +329,7 @@ const cardBlock: BlockSchema = {
variable values, what slot content. It is a definition, not a component - nothing
resolves `blockId` or expands the block it names.

```plaintext
```ts
import type { BlockInstanceSchema } from '@object-ui/types';

const instance: BlockInstanceSchema = {
Expand DownExpand Up@@ -365,8 +369,11 @@ selected it and the listings it returned. It is a data shape, not a browser comp
nothing renders a library, and `onInstall` / `onPreview` name handlers that no dispatcher
looks up.

```plaintext
import type { BlockLibrarySchema } from '@object-ui/types';
```ts
import type { BlockLibrarySchema, BlockSchema } from '@object-ui/types';

// The block defined under "Basic Usage" above.
declare const heroBlock: BlockSchema;

const library: BlockLibrarySchema = {
type: 'block-library',
Expand DownExpand Up@@ -403,8 +410,11 @@ const library: BlockLibrarySchema = {
open and which panels a host would show. It is a configuration shape, not an editor
component - no block editor exists to consume it.

```plaintext
import type { BlockEditorSchema } from '@object-ui/types';
```ts
import type { BlockEditorSchema, BlockSchema } from '@object-ui/types';

// The block defined under "Complete Example" above.
declare const cardBlock: BlockSchema;

const editor: BlockEditorSchema = {
type: 'block-editor',
Expand All@@ -423,7 +433,9 @@ const editor: BlockEditorSchema = {

## Marketplace Example

```plaintext
```ts
import type { BlockLibrarySchema } from '@object-ui/types';

const marketplace: BlockLibrarySchema = {
type: 'block-library',
apiEndpoint: 'https://blocks.objectui.com/api',
Expand All@@ -444,7 +456,7 @@ const marketplace: BlockLibrarySchema = {
premium: false,
preview: 'https://blocks.objectui.com/previews/pricing-table.png'
},
schema: { /* block schema */ },
schema: { type: 'block', meta: { name: 'pricing-table-pro' } },
installs: 5420,
rating: 4.9,
ratingCount: 234,
Expand All@@ -463,7 +475,7 @@ const marketplace: BlockLibrarySchema = {
version: '1.3.0',
premium: true
},
schema: { /* block schema */ },
schema: { type: 'block', meta: { name: 'testimonial-slider' } },
installs: 2150,
rating: 4.7,
ratingCount: 89
Expand All@@ -474,9 +486,12 @@ const marketplace: BlockLibrarySchema = {

## Runtime Validation

```plaintext
```ts
import { BlockSchema } from '@object-ui/types/zod';

// The block configuration to validate.
declare const myBlock: unknown;

const result = BlockSchema.safeParse(myBlock);

if (result.success) {
Expand Down
2 changes: 1 addition & 1 deletion content/docs/plugins/plugin-charts.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -262,7 +262,7 @@ const schema = {

## TypeScript Support

```plaintext
```ts
import type { BarChartSchema } from '@object-ui/plugin-charts'

const chartSchema: BarChartSchema = {
Expand Down
2 changes: 1 addition & 1 deletion content/docs/plugins/plugin-editor.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -137,7 +137,7 @@ This keeps your main application bundle small while providing full IDE-like edit

## TypeScript Support

```plaintext
```ts
import type { CodeEditorSchema } from '@object-ui/plugin-editor'

const editorSchema: CodeEditorSchema = {
Expand Down
4 changes: 2 additions & 2 deletions content/docs/plugins/plugin-form.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -212,7 +212,7 @@ spec rejects `pane` on non-split form types at parse.)

### Registration is a side effect of the import

```plaintext
```ts
import '@object-ui/plugin-form';
```

Expand DownExpand Up@@ -242,7 +242,7 @@ claims it.
To serve one of this package's components under a key of your own, register the
exported component — that is what a manual registration is here:

```plaintext
```ts
import { ComponentRegistry } from '@object-ui/core';
import { ObjectForm } from '@object-ui/plugin-form';

Expand Down
4 changes: 2 additions & 2 deletions content/docs/plugins/plugin-grid.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -170,7 +170,7 @@ view whose columns are all `none` (or carry no `summary`) has no footer.

### Registration is a side effect of the import

```plaintext
```ts
import '@object-ui/plugin-grid';
```

Expand DownExpand Up@@ -200,7 +200,7 @@ the CSS Grid *layout* container in `@object-ui/components`
To serve the data grid under a key of your own, register the exported renderer —
that is what a manual registration is here:

```plaintext
```ts
import { ComponentRegistry } from '@object-ui/core';
import { ObjectGridRenderer } from '@object-ui/plugin-grid';

Expand Down
2 changes: 1 addition & 1 deletion content/docs/plugins/plugin-markdown.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -347,7 +347,7 @@ The plugin uses lazy loading to optimize bundle size:

## TypeScript Support

```plaintext
```ts
import type { MarkdownSchema } from '@object-ui/plugin-markdown'

const markdownSchema: MarkdownSchema = {
Expand Down
4 changes: 2 additions & 2 deletions content/docs/plugins/plugin-view.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -202,7 +202,7 @@ path only (the row above, and the section below), so on a non-grid

### Registration is a side effect of the import

```plaintext
```ts
import '@object-ui/plugin-view';
```

Expand DownExpand Up@@ -238,7 +238,7 @@ than as a schema key.
To serve one of this package's components under a key of your own, register the
exported component — that is what a manual registration is here:

```plaintext
```ts
import { ComponentRegistry } from '@object-ui/core';
import { ViewSwitcher } from '@object-ui/plugin-view';

Expand Down