@nextlyhq/plugin-sdk 0.0.2-alpha.58 → 0.0.2-alpha.62

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/admin.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- export { BulkAction, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardProps, CardTitle, CellContext, CellRenderer, CellRendererDefinition, ColumnProvider, ColumnTransform, ComponentPath, ConditionOperatorName, ConditionRange, ConditionRow, ConditionRowProps, ConditionSource, ConditionSourceOption, ConditionValue, DataTable, DataTableContext, DataTableProps, DataTableSelection, DataTableTarget, DataTableView, DataTableViewProps, FieldDefaultOption, FieldDefaultValueInput, FieldDefaultValueInputProps, FieldOption, FieldOptionsEditor, FieldOptionsEditorProps, FieldTypePicker, FieldTypePickerProps, Grid, GridProps, NextlyColumn, NextlyFieldSchema, NextlyFieldType, RowAction, Stack, StackProps, Stat, StatProps, operatorTakesValue, operatorsForType, registerBulkAction, registerCellRenderer, registerColumns, registerComponent, registerComponents, registerKnownPlugin, registerRowAction, transformColumns, usePluginClientConfig, usePluginFieldTypeEntries, withOptionIds } from '@nextlyhq/admin';
1
+ export { AdminChromeLayer, ApiError, AutosaveStatus, BulkAction, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardProps, CardTitle, CellContext, CellRenderer, CellRendererDefinition, Checkbox, ColumnProvider, ColumnTransform, ComponentPath, ConditionOperatorName, ConditionRange, ConditionRow, ConditionRowProps, ConditionSource, ConditionSourceOption, ConditionValue, DataTable, DataTableContext, DataTableProps, DataTableSelection, DataTableTarget, DataTableView, DataTableViewProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DocumentIdentity, DocumentLocale, DocumentStatus, EDITABLE_VALIDATION_RULES, FieldDefaultOption, FieldDefaultValueInput, FieldDefaultValueInputProps, FieldOption, FieldOptionsEditor, FieldOptionsEditorProps, FieldShell, FieldShellProps, FieldShellRenderProps, FieldTypePicker, FieldTypePickerProps, FieldWidth, FormActions, FormActionsProps, FormSection, FormSectionProps, Grid, GridProps, InlineRichTextAttachment, InlineRichTextEditor, InlineRichTextRefusal, InlineRichTextSession, Input, Label, NextlyColumn, NextlyFieldSchema, NextlyFieldType, PILL_LABEL, PillState, RichTextEditorKit, RowAction, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SingleDocument, Stack, StackProps, Stat, StatProps, Switch, Textarea, UseDocumentCheckpointOptions, UseDocumentCheckpointResult, ValidationIssue, ValidationNumberField, ValidationNumberFieldProps, ValidationRuleValues, ValidationRulesEditor, ValidationRulesEditorProps, drawsAnyValidationRule, isApiError, loadInlineRichTextEditor, loadRichTextEditorKit, operatorTakesValue, operatorsForType, pillStateFromForm, registerBulkAction, registerCellRenderer, registerColumns, registerComponent, registerComponents, registerKnownPlugin, registerRowAction, transformColumns, useDocumentCheckpoint, useDocumentIdentity, useDocumentLocale, useDocumentStatus, useEntryFieldsPanel, usePluginClientConfig, usePluginFieldTypeEntries, useReportUnsavedWork, useSingleDocument, useSuppressAdminChrome, useUpdateSingleDocument, validationIssues, withOptionIds } from '@nextlyhq/admin';
2
2
  export { JsonObject, JsonValue, PluginAdminContributions, PluginAdminPage, PluginCollectionView, PluginMenuItem } from 'nextly';
3
+ import 'nextly/runtime';
3
4
  import 'nextly/testing';
package/dist/admin.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ConditionRow, DataTable, DataTableView, FieldDefaultValueInput, FieldOptionsEditor, FieldTypePicker, Grid, Stack, Stat, operatorTakesValue, operatorsForType, registerBulkAction, registerCellRenderer, registerColumns, registerComponent, registerComponents, registerKnownPlugin, registerRowAction, transformColumns, usePluginClientConfig, usePluginFieldTypeEntries, withOptionIds } from '@nextlyhq/admin';
1
+ export { Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ConditionRow, DataTable, DataTableView, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, EDITABLE_VALIDATION_RULES, FieldDefaultValueInput, FieldOptionsEditor, FieldShell, FieldTypePicker, FormActions, FormSection, Grid, Input, Label, PILL_LABEL, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Stack, Stat, Switch, Textarea, ValidationNumberField, ValidationRulesEditor, drawsAnyValidationRule, isApiError, loadInlineRichTextEditor, loadRichTextEditorKit, operatorTakesValue, operatorsForType, pillStateFromForm, registerBulkAction, registerCellRenderer, registerColumns, registerComponent, registerComponents, registerKnownPlugin, registerRowAction, transformColumns, useDocumentCheckpoint, useDocumentIdentity, useDocumentLocale, useDocumentStatus, useEntryFieldsPanel, usePluginClientConfig, usePluginFieldTypeEntries, useReportUnsavedWork, useSingleDocument, useSuppressAdminChrome, useUpdateSingleDocument, validationIssues, withOptionIds } from '@nextlyhq/admin';
2
2
  //# sourceMappingURL=admin.mjs.map
3
3
  //# sourceMappingURL=admin.mjs.map
package/dist/blocks.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BlockDefinition as BlockDefinition$1, BlockRenderArgs as BlockRenderArgs$1 } from '@nextlyhq/blocks-engine';
2
- export { AnyBlockDefinition, BlockEditorMeta, BlockExample, BlockSeoContribution, BlockSeoImage, BlockVariation, ComponentPath, InferBlockProps, NodeStyles, PropSchema, SlotLock, SlotSpec, SupportDefinition } from '@nextlyhq/blocks-engine';
2
+ export { AnyBlockDefinition, BlockEditorMeta, BlockExample, BlockIcon, BlockIsland, BlockPart, BlockSeoContribution, BlockSeoImage, BlockVariation, ComponentPath, InferBlockProps, NodeStyles, PropSchema, SlotLock, SlotSpec, SupportDefinition } from '@nextlyhq/blocks-engine';
3
3
  import { ReactNode } from 'react';
4
4
 
5
5
  /**
@@ -93,6 +93,8 @@ interface BlockSupportKeys {
93
93
  position: never;
94
94
  /** Container-query behaviour. */
95
95
  container: never;
96
+ /** Marker style on a list. */
97
+ list: never;
96
98
  /** Author-written CSS on this block. Gates a capability, not a style group. */
97
99
  customCss: never;
98
100
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/blocks.ts"],"names":[],"mappings":";AAyQO,SAAS,YACd,UAAA,EACoB;AACpB,EAAA,OAAO,UAAA;AACT;AA0BO,SAAS,cACd,QAAA,EACe;AACf,EAAA,OAAO,QAAA;AACT","file":"blocks.mjs","sourcesContent":["/**\n * Block authoring — the contracts a plugin contributing blocks to the page\n * builder needs.\n *\n * A subpath rather than the SDK's main entry, so a plugin that has nothing to\n * do with blocks never pulls the block engine into its type graph. The SDK\n * remains the single stable import surface a plugin author is offered; this\n * simply keeps a page-builder-specific vocabulary out of everyone else's way.\n *\n * The engine is a real dependency of this package rather than an optional peer,\n * because the types below are built on top of its own: they have to resolve for\n * an author who installed only the SDK, and under a strict `node_modules`\n * layout the page builder's copy is not reachable from their package. The\n * engine's registry is pinned to `globalThis`, so even a duplicated install\n * still reads and writes the one registry the page builder consumes.\n *\n * What an author writes is declared here rather than re-exported. `defineBlock`\n * and `BlockSupports` are this module's own so that `BlockSupportKeys` can be\n * augmented from a plugin's source, which only works for a module that plugin\n * can name.\n *\n * The registration side is not here. Contributing a block means calling the\n * page builder's own service — it is that plugin's registry, not core's — so\n * `blockRegistry` comes from `@nextlyhq/plugin-page-builder/blocks`, which is\n * also where a contributor already declares its `dependsOn`.\n *\n * @packageDocumentation\n */\n\nimport type {\n BlockDefinition as EngineBlockDefinition,\n BlockRenderArgs as EngineBlockRenderArgs,\n} from \"@nextlyhq/blocks-engine\";\nimport type { ReactNode } from \"react\";\n\n/**\n * The support keys a block may declare.\n *\n * Declared HERE rather than in the engine, and that placement is the whole\n * point. A module augmentation has to name a module that resolves from the file\n * doing the augmenting, and a plugin author installs this package: under a\n * strict `node_modules` layout the engine is a nested transitive dependency\n * their own source cannot name, so an augmentation pointed at it fails to\n * compile and the custom support silently never arrives.\n *\n * A plugin that calls `registerSupport()` adds its key to the vocabulary the\n * compiler checks against:\n *\n * ```ts\n * declare module \"@nextlyhq/plugin-sdk/blocks\" {\n * interface BlockSupportKeys {\n * animation: \"enter\" | \"exit\";\n * parallax: true;\n * }\n * }\n * ```\n *\n * Declaration merging rather than an index signature: an index signature accepts\n * every key, which is what leaves a misspelled `spaceing` to be found at boot,\n * in someone else's app, instead of while it is being written.\n *\n * One rule reads the value: a union of strings names the sub-flags the support\n * recognises, and anything else means the support is all-or-nothing. So a nested\n * typo is caught in the same breath as a top-level one — `{ spacing: { paddding:\n * true } }` enables nothing at all, and finding that out at boot is exactly what\n * this exists to prevent — while a support with no finer granularity can be\n * written the way it reads, as `never` or as `true`.\n *\n * The built-in keys are the style catalog's groups plus the capabilities that\n * have no catalog group of their own. A test holds both the keys and their\n * flags to what the registry actually accepts, so the two cannot drift.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport interface BlockSupportKeys {\n /** Padding and margin. */\n spacing: \"margin\" | \"padding\";\n /** Flow, alignment and gap. */\n layout: never;\n /** Width, height and their limits. */\n dimensions: never;\n /** Font, size, weight, line height and letter spacing. */\n typography: never;\n /** Text and link colours. */\n color: \"text\" | \"link\";\n /** Background colour, image and gradient. */\n background: \"color\" | \"image\" | \"gradient\";\n /** Border lines and corner rounding. */\n border: \"line\" | \"radius\";\n /** Box and text shadows. */\n shadow: never;\n /** Opacity, filters and transforms. */\n effects: never;\n /** Positioning and stacking. */\n position: never;\n /** Container-query behaviour. */\n container: never;\n /** Author-written CSS on this block. Gates a capability, not a style group. */\n customCss: never;\n}\n\n/**\n * What one support key accepts, given the sub-flags it declares.\n *\n * The two cases are kept apart rather than both handed to `Record`, because\n * `Record` demands a property key and a support that declares no flags has none\n * to give. Feeding it either sentinel is unsound in opposite directions: `true`\n * is not a property key at all, so the mapped type stops instantiating and an\n * augmenting plugin's build fails on the declaration rather than on anything it\n * wrote; `never` produces `Partial<Record<never, boolean>>`, which is `{}`, and\n * `{}` accepts every object — so `{ layout: { typo: true } }` type-checks and is\n * refused only later, by the registry, at boot.\n *\n * `[F] extends [never]` is asked first and in tuple form. Bare `F extends never`\n * distributes and answers for the empty union rather than about it, and\n * `[never] extends [string]` is true, so a `never` reaching the string case\n * would rebuild the same `{}`.\n */\ntype SupportSetting<F> = [F] extends [never]\n ? boolean\n : [F] extends [string]\n ? boolean | Partial<Record<F & string, boolean>>\n : boolean;\n\n/**\n * Style capabilities a block opts into: `true` for a whole group, or an object\n * naming the sub-flags it wants.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport type BlockSupports = {\n [K in keyof BlockSupportKeys]?: SupportSetting<BlockSupportKeys[K]>;\n};\n\n/**\n * Supports as written at a definition, with unknown keys refused.\n *\n * TypeScript checks for excess properties only on a literal written in place,\n * so lifting settings into a shared object skips it: `const shared = { spacing:\n * true, spaceing: true }` assigns to `BlockSupports` without complaint, and the\n * typo survives to be caught at boot in someone else's app — which is the whole\n * failure this vocabulary exists to move earlier.\n *\n * Naming the offending key as `never` refuses it wherever it was written.\n */\ntype ExactSupports<S> = S & {\n [K in Exclude<keyof S, keyof BlockSupportKeys>]: never;\n};\n\n/**\n * Everything a renderer makes available to every block it draws.\n *\n * ONE description per app, rather than each block inventing its own. A block\n * author writes `defineBlock<MyProps>` and `ctx` is already typed as whatever\n * this app's renderer provides, with no type written by hand; a block that\n * needs something unusual has to add it here, which is an app-wide statement\n * anyone can see rather than a quiet assumption inside one file.\n *\n * A renderer declares what it supplies by augmenting this from its own package:\n *\n * ```ts\n * declare module \"@nextlyhq/plugin-sdk/blocks\" {\n * interface BlockRenderContext {\n * data?: DataProvider;\n * }\n * }\n * ```\n *\n * `locale` is here because every renderer of localized content has one, and a\n * block that varies its own output by language should not have to reach past\n * this interface to find out which.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport interface BlockRenderContext {\n /** The locale being rendered, when the renderer is rendering one. */\n locale?: string;\n}\n\n/**\n * What a block's `render` receives.\n *\n * The engine's own version leaves both the context and the output unnamed,\n * because the engine serves any renderer and cannot know either. This one names\n * both: the context is what THIS app's renderer provides, which is what lets a\n * block read `ctx.data` with no type written by hand, and the output is React,\n * which is what lets a block place a slot straight into its JSX instead of\n * asserting a type over it.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport interface BlockRenderArgs<P>\n extends Omit<EngineBlockRenderArgs<P, BlockRenderContext>, \"renderSlot\"> {\n /**\n * Render one of this block's slots, optionally under a different context.\n *\n * `ReactNode` rather than the `ReactNode | Promise<ReactNode>` that `render`\n * returns, and the asymmetry is deliberate: this value is one a block places\n * into its own JSX, and that union is not a legal child under EITHER supported\n * peer. React 18 admits no promise at all; React 19 admits only\n * `Promise<AwaitedReactNode>`, a promise of a settled node, so a promise that\n * may itself yield a promise is refused there too. Widening here would move\n * the error onto every block that draws a slot.\n *\n * It still says what each peer can express, because React 19 counts\n * `Promise<AwaitedReactNode>` as a `ReactNode`: a renderer on 19 may hand back\n * a pending slot and the block places it unchanged. On 18 it may not, which\n * costs nothing, since an async block cannot be drawn under React 18's types\n * regardless — `<AsyncBlock />` is refused outright there.\n */\n renderSlot(this: void, name: string, ctx?: BlockRenderContext): ReactNode;\n}\n\n/**\n * One block type, as an author writes it.\n *\n * The engine's own definition leaves `supports` open, because its registry holds\n * blocks from every source and checks their keys at boot against whatever is\n * registered. Authoring is the moment a typo is cheap to catch, so this narrows\n * that one member and changes nothing else.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport interface BlockDefinition<P extends object = Record<string, unknown>>\n extends Omit<\n EngineBlockDefinition<P, BlockRenderContext>,\n // `conditionalSlots` is withheld ON PURPOSE. It exists because a core block\n // needs it, and what a block author should write is a Block API freeze\n // decision — but an `@internal` tag removes nothing from a published type,\n // and this `Omit` inherits every property it does not name. Reserving it\n // takes naming it here; anything less lets a plugin compile against a\n // provisional shape and be broken when the freeze settles it.\n \"supports\" | \"render\" | \"conditionalSlots\"\n > {\n supports?: BlockSupports;\n /**\n * Renders the block.\n *\n * The promise is spelled out rather than left to `ReactNode`. React 19 added\n * promises to that type and React 18 did not, and this package supports both,\n * so an async block would compile against one peer and be rejected by the\n * other. Naming it here makes the async contract mean the same thing across\n * the range this package declares.\n */\n render(args: BlockRenderArgs<P>): BlockRenderResult;\n}\n\n/**\n * Declare a block.\n *\n * Returns its argument. It exists to infer the prop type from what is written\n * and to check the rest against the definition shape, which is what makes a\n * mistyped prop name or an unknown support key a compile error rather than a\n * boot one.\n *\n * There is deliberately no per-block context parameter. What a renderer\n * provides is one description per app, and a block that needs something unusual\n * declares it on `BlockRenderContext` where the whole app can see it. A block\n * naming its own context would be asserting privately that it will be handed\n * something, which nothing checks and no registry can honour.\n *\n * @experimental The block API is frozen at the end of the engine phase, not\n * now. Until then a contributed block may need changes when the definition\n * shape settles.\n */\nexport function defineBlock<P extends object>(\n definition: BlockDefinition<P>\n): BlockDefinition<P> {\n return definition;\n}\n\n/**\n * Supports settings meant to be shared between blocks.\n *\n * Written straight into a definition, a typo is caught: TypeScript checks a\n * literal for keys the target does not declare. Lifted into a variable first,\n * it is not, because that check applies only where the literal is written. This\n * puts the check back at the declaration, which is where the settings are.\n *\n * ```ts\n * const layoutSupports = blockSupports({ spacing: true, layout: true });\n * defineBlock<MyProps>({ …, supports: layoutSupports });\n * ```\n *\n * `satisfies BlockSupports` does the same thing and needs nothing from this\n * package; the helper exists because it reads as the obvious move and cannot be\n * forgotten halfway through.\n *\n * It cannot live on `defineBlock` itself: catching this needs the supplied\n * object's own keys inferred, and TypeScript infers nothing once any type\n * argument is written by hand, so `defineBlock<MyProps>` — the form nearly\n * every block uses — would stop checking anything at all.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport function blockSupports<S extends BlockSupports>(\n supports: ExactSupports<S>\n): BlockSupports {\n return supports;\n}\n\n/**\n * @experimental Carried by the same freeze as `defineBlock`: these describe the\n * definition shape, so they change with it.\n */\nexport type {\n AnyBlockDefinition,\n InferBlockProps,\n PropSchema,\n SupportDefinition,\n} from \"@nextlyhq/blocks-engine\";\n\n/**\n * What a block's `render` returns.\n *\n * Declared here rather than re-exported. The engine's own is `unknown`, because\n * the engine serves any renderer and cannot name an output type; naming it there\n * would tie a runtime-free package to React. That leaves the re-exported name\n * useless for the thing an author would reach for it to do — a helper typed\n * `(args: BlockRenderArgs<P>) => BlockRenderResult` returns `unknown`, which does\n * not satisfy `BlockDefinition[\"render\"]`, so handing that helper to\n * `defineBlock` failed to compile.\n *\n * The promise is spelled out for the same reason `render` spells it out: React\n * 19 added promises to `ReactNode` and React 18 did not, and this package\n * supports both.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport type BlockRenderResult = ReactNode | Promise<ReactNode>;\n\n/**\n * The rest of the definition's own vocabulary. Every one of these names a field\n * a block author fills in, so leaving them off this surface meant writing a slot\n * template, an example, or an editor entry against a type that could only be\n * reached by importing the engine directly — which is the one thing this subpath\n * exists to make unnecessary.\n *\n * `BlockSupportValue` is deliberately NOT among them. The engine's is\n * `boolean | Record<string, boolean>`, which is what its registry stores from\n * every source; offered here as authoring vocabulary it would undo the check\n * this module exists for, since `const spacing: BlockSupportValue = { paddding:\n * true }` accepts the typo the per-key flag unions refuse. A shared setting for\n * one key is written as `BlockSupports[\"spacing\"]`, which is checked, and a\n * whole object goes through `blockSupports()`.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport type {\n BlockEditorMeta,\n BlockExample,\n BlockSeoContribution,\n BlockSeoImage,\n BlockVariation,\n ComponentPath,\n NodeStyles,\n SlotLock,\n SlotSpec,\n} from \"@nextlyhq/blocks-engine\";\n"]}
1
+ {"version":3,"sources":["../src/blocks.ts"],"names":[],"mappings":";AA2QO,SAAS,YACd,UAAA,EACoB;AACpB,EAAA,OAAO,UAAA;AACT;AA0BO,SAAS,cACd,QAAA,EACe;AACf,EAAA,OAAO,QAAA;AACT","file":"blocks.mjs","sourcesContent":["/**\n * Block authoring — the contracts a plugin contributing blocks to the page\n * builder needs.\n *\n * A subpath rather than the SDK's main entry, so a plugin that has nothing to\n * do with blocks never pulls the block engine into its type graph. The SDK\n * remains the single stable import surface a plugin author is offered; this\n * simply keeps a page-builder-specific vocabulary out of everyone else's way.\n *\n * The engine is a real dependency of this package rather than an optional peer,\n * because the types below are built on top of its own: they have to resolve for\n * an author who installed only the SDK, and under a strict `node_modules`\n * layout the page builder's copy is not reachable from their package. The\n * engine's registry is pinned to `globalThis`, so even a duplicated install\n * still reads and writes the one registry the page builder consumes.\n *\n * What an author writes is declared here rather than re-exported. `defineBlock`\n * and `BlockSupports` are this module's own so that `BlockSupportKeys` can be\n * augmented from a plugin's source, which only works for a module that plugin\n * can name.\n *\n * The registration side is not here. Contributing a block means calling the\n * page builder's own service — it is that plugin's registry, not core's — so\n * `blockRegistry` comes from `@nextlyhq/plugin-page-builder/blocks`, which is\n * also where a contributor already declares its `dependsOn`.\n *\n * @packageDocumentation\n */\n\nimport type {\n BlockDefinition as EngineBlockDefinition,\n BlockRenderArgs as EngineBlockRenderArgs,\n} from \"@nextlyhq/blocks-engine\";\nimport type { ReactNode } from \"react\";\n\n/**\n * The support keys a block may declare.\n *\n * Declared HERE rather than in the engine, and that placement is the whole\n * point. A module augmentation has to name a module that resolves from the file\n * doing the augmenting, and a plugin author installs this package: under a\n * strict `node_modules` layout the engine is a nested transitive dependency\n * their own source cannot name, so an augmentation pointed at it fails to\n * compile and the custom support silently never arrives.\n *\n * A plugin that calls `registerSupport()` adds its key to the vocabulary the\n * compiler checks against:\n *\n * ```ts\n * declare module \"@nextlyhq/plugin-sdk/blocks\" {\n * interface BlockSupportKeys {\n * animation: \"enter\" | \"exit\";\n * parallax: true;\n * }\n * }\n * ```\n *\n * Declaration merging rather than an index signature: an index signature accepts\n * every key, which is what leaves a misspelled `spaceing` to be found at boot,\n * in someone else's app, instead of while it is being written.\n *\n * One rule reads the value: a union of strings names the sub-flags the support\n * recognises, and anything else means the support is all-or-nothing. So a nested\n * typo is caught in the same breath as a top-level one — `{ spacing: { paddding:\n * true } }` enables nothing at all, and finding that out at boot is exactly what\n * this exists to prevent — while a support with no finer granularity can be\n * written the way it reads, as `never` or as `true`.\n *\n * The built-in keys are the style catalog's groups plus the capabilities that\n * have no catalog group of their own. A test holds both the keys and their\n * flags to what the registry actually accepts, so the two cannot drift.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport interface BlockSupportKeys {\n /** Padding and margin. */\n spacing: \"margin\" | \"padding\";\n /** Flow, alignment and gap. */\n layout: never;\n /** Width, height and their limits. */\n dimensions: never;\n /** Font, size, weight, line height and letter spacing. */\n typography: never;\n /** Text and link colours. */\n color: \"text\" | \"link\";\n /** Background colour, image and gradient. */\n background: \"color\" | \"image\" | \"gradient\";\n /** Border lines and corner rounding. */\n border: \"line\" | \"radius\";\n /** Box and text shadows. */\n shadow: never;\n /** Opacity, filters and transforms. */\n effects: never;\n /** Positioning and stacking. */\n position: never;\n /** Container-query behaviour. */\n container: never;\n /** Marker style on a list. */\n list: never;\n /** Author-written CSS on this block. Gates a capability, not a style group. */\n customCss: never;\n}\n\n/**\n * What one support key accepts, given the sub-flags it declares.\n *\n * The two cases are kept apart rather than both handed to `Record`, because\n * `Record` demands a property key and a support that declares no flags has none\n * to give. Feeding it either sentinel is unsound in opposite directions: `true`\n * is not a property key at all, so the mapped type stops instantiating and an\n * augmenting plugin's build fails on the declaration rather than on anything it\n * wrote; `never` produces `Partial<Record<never, boolean>>`, which is `{}`, and\n * `{}` accepts every object — so `{ layout: { typo: true } }` type-checks and is\n * refused only later, by the registry, at boot.\n *\n * `[F] extends [never]` is asked first and in tuple form. Bare `F extends never`\n * distributes and answers for the empty union rather than about it, and\n * `[never] extends [string]` is true, so a `never` reaching the string case\n * would rebuild the same `{}`.\n */\ntype SupportSetting<F> = [F] extends [never]\n ? boolean\n : [F] extends [string]\n ? boolean | Partial<Record<F & string, boolean>>\n : boolean;\n\n/**\n * Style capabilities a block opts into: `true` for a whole group, or an object\n * naming the sub-flags it wants.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport type BlockSupports = {\n [K in keyof BlockSupportKeys]?: SupportSetting<BlockSupportKeys[K]>;\n};\n\n/**\n * Supports as written at a definition, with unknown keys refused.\n *\n * TypeScript checks for excess properties only on a literal written in place,\n * so lifting settings into a shared object skips it: `const shared = { spacing:\n * true, spaceing: true }` assigns to `BlockSupports` without complaint, and the\n * typo survives to be caught at boot in someone else's app — which is the whole\n * failure this vocabulary exists to move earlier.\n *\n * Naming the offending key as `never` refuses it wherever it was written.\n */\ntype ExactSupports<S> = S & {\n [K in Exclude<keyof S, keyof BlockSupportKeys>]: never;\n};\n\n/**\n * Everything a renderer makes available to every block it draws.\n *\n * ONE description per app, rather than each block inventing its own. A block\n * author writes `defineBlock<MyProps>` and `ctx` is already typed as whatever\n * this app's renderer provides, with no type written by hand; a block that\n * needs something unusual has to add it here, which is an app-wide statement\n * anyone can see rather than a quiet assumption inside one file.\n *\n * A renderer declares what it supplies by augmenting this from its own package:\n *\n * ```ts\n * declare module \"@nextlyhq/plugin-sdk/blocks\" {\n * interface BlockRenderContext {\n * data?: DataProvider;\n * }\n * }\n * ```\n *\n * `locale` is here because every renderer of localized content has one, and a\n * block that varies its own output by language should not have to reach past\n * this interface to find out which.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport interface BlockRenderContext {\n /** The locale being rendered, when the renderer is rendering one. */\n locale?: string;\n}\n\n/**\n * What a block's `render` receives.\n *\n * The engine's own version leaves both the context and the output unnamed,\n * because the engine serves any renderer and cannot know either. This one names\n * both: the context is what THIS app's renderer provides, which is what lets a\n * block read `ctx.data` with no type written by hand, and the output is React,\n * which is what lets a block place a slot straight into its JSX instead of\n * asserting a type over it.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport interface BlockRenderArgs<P>\n extends Omit<EngineBlockRenderArgs<P, BlockRenderContext>, \"renderSlot\"> {\n /**\n * Render one of this block's slots, optionally under a different context.\n *\n * `ReactNode` rather than the `ReactNode | Promise<ReactNode>` that `render`\n * returns, and the asymmetry is deliberate: this value is one a block places\n * into its own JSX, and that union is not a legal child under EITHER supported\n * peer. React 18 admits no promise at all; React 19 admits only\n * `Promise<AwaitedReactNode>`, a promise of a settled node, so a promise that\n * may itself yield a promise is refused there too. Widening here would move\n * the error onto every block that draws a slot.\n *\n * It still says what each peer can express, because React 19 counts\n * `Promise<AwaitedReactNode>` as a `ReactNode`: a renderer on 19 may hand back\n * a pending slot and the block places it unchanged. On 18 it may not, which\n * costs nothing, since an async block cannot be drawn under React 18's types\n * regardless — `<AsyncBlock />` is refused outright there.\n */\n renderSlot(this: void, name: string, ctx?: BlockRenderContext): ReactNode;\n}\n\n/**\n * One block type, as an author writes it.\n *\n * The engine's own definition leaves `supports` open, because its registry holds\n * blocks from every source and checks their keys at boot against whatever is\n * registered. Authoring is the moment a typo is cheap to catch, so this narrows\n * that one member and changes nothing else.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport interface BlockDefinition<P extends object = Record<string, unknown>>\n extends Omit<\n EngineBlockDefinition<P, BlockRenderContext>,\n // `conditionalSlots` is withheld ON PURPOSE. It exists because a core block\n // needs it, and what a block author should write is a Block API freeze\n // decision — but an `@internal` tag removes nothing from a published type,\n // and this `Omit` inherits every property it does not name. Reserving it\n // takes naming it here; anything less lets a plugin compile against a\n // provisional shape and be broken when the freeze settles it.\n \"supports\" | \"render\" | \"conditionalSlots\"\n > {\n supports?: BlockSupports;\n /**\n * Renders the block.\n *\n * The promise is spelled out rather than left to `ReactNode`. React 19 added\n * promises to that type and React 18 did not, and this package supports both,\n * so an async block would compile against one peer and be rejected by the\n * other. Naming it here makes the async contract mean the same thing across\n * the range this package declares.\n */\n render(args: BlockRenderArgs<P>): BlockRenderResult;\n}\n\n/**\n * Declare a block.\n *\n * Returns its argument. It exists to infer the prop type from what is written\n * and to check the rest against the definition shape, which is what makes a\n * mistyped prop name or an unknown support key a compile error rather than a\n * boot one.\n *\n * There is deliberately no per-block context parameter. What a renderer\n * provides is one description per app, and a block that needs something unusual\n * declares it on `BlockRenderContext` where the whole app can see it. A block\n * naming its own context would be asserting privately that it will be handed\n * something, which nothing checks and no registry can honour.\n *\n * @experimental The block API is frozen at the end of the engine phase, not\n * now. Until then a contributed block may need changes when the definition\n * shape settles.\n */\nexport function defineBlock<P extends object>(\n definition: BlockDefinition<P>\n): BlockDefinition<P> {\n return definition;\n}\n\n/**\n * Supports settings meant to be shared between blocks.\n *\n * Written straight into a definition, a typo is caught: TypeScript checks a\n * literal for keys the target does not declare. Lifted into a variable first,\n * it is not, because that check applies only where the literal is written. This\n * puts the check back at the declaration, which is where the settings are.\n *\n * ```ts\n * const layoutSupports = blockSupports({ spacing: true, layout: true });\n * defineBlock<MyProps>({ …, supports: layoutSupports });\n * ```\n *\n * `satisfies BlockSupports` does the same thing and needs nothing from this\n * package; the helper exists because it reads as the obvious move and cannot be\n * forgotten halfway through.\n *\n * It cannot live on `defineBlock` itself: catching this needs the supplied\n * object's own keys inferred, and TypeScript infers nothing once any type\n * argument is written by hand, so `defineBlock<MyProps>` — the form nearly\n * every block uses — would stop checking anything at all.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport function blockSupports<S extends BlockSupports>(\n supports: ExactSupports<S>\n): BlockSupports {\n return supports;\n}\n\n/**\n * @experimental Carried by the same freeze as `defineBlock`: these describe the\n * definition shape, so they change with it.\n */\nexport type {\n AnyBlockDefinition,\n InferBlockProps,\n PropSchema,\n SupportDefinition,\n} from \"@nextlyhq/blocks-engine\";\n\n/**\n * What a block's `render` returns.\n *\n * Declared here rather than re-exported. The engine's own is `unknown`, because\n * the engine serves any renderer and cannot name an output type; naming it there\n * would tie a runtime-free package to React. That leaves the re-exported name\n * useless for the thing an author would reach for it to do — a helper typed\n * `(args: BlockRenderArgs<P>) => BlockRenderResult` returns `unknown`, which does\n * not satisfy `BlockDefinition[\"render\"]`, so handing that helper to\n * `defineBlock` failed to compile.\n *\n * The promise is spelled out for the same reason `render` spells it out: React\n * 19 added promises to `ReactNode` and React 18 did not, and this package\n * supports both.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport type BlockRenderResult = ReactNode | Promise<ReactNode>;\n\n/**\n * The rest of the definition's own vocabulary. Every one of these names a field\n * a block author fills in, so leaving them off this surface meant writing a slot\n * template, an example, or an editor entry against a type that could only be\n * reached by importing the engine directly — which is the one thing this subpath\n * exists to make unnecessary.\n *\n * `BlockSupportValue` is deliberately NOT among them. The engine's is\n * `boolean | Record<string, boolean>`, which is what its registry stores from\n * every source; offered here as authoring vocabulary it would undo the check\n * this module exists for, since `const spacing: BlockSupportValue = { paddding:\n * true }` accepts the typo the per-key flag unions refuse. A shared setting for\n * one key is written as `BlockSupports[\"spacing\"]`, which is checked, and a\n * whole object goes through `blockSupports()`.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport type {\n BlockEditorMeta,\n BlockExample,\n BlockIcon,\n BlockIsland,\n BlockPart,\n BlockSeoContribution,\n BlockSeoImage,\n BlockVariation,\n ComponentPath,\n NodeStyles,\n SlotLock,\n SlotSpec,\n} from \"@nextlyhq/blocks-engine\";\n"]}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { Action, AuthEventName, AuthEvents, AuthHookName, AuthHooks, AuthInput, AuthOutcome, AuthStrategy, AuthUser, AuthorableFieldConfig, BatchOperationResult, BeforeOperationArgs, BeforeOperationContext, BeforeOperationHandler, Challenge, ChallengeDefinition, ComponentPath, CoreFilterSeam, DocumentEventName, DocumentEvents, EmailAfterSendValue, EmailFilterContext, EmailPayloadFilterValue, EmailProviderCapabilities, EmailProviderConfigField, EmailProviderDefinition, EmailProviderDescriptor, EventBus, EventEnvelope, EventHandler, EventName, FieldAdminOptions, FieldConfig, FieldValueDeclaration, FieldValueDeclarationInput, Filter, FilterSeams, HookContext, HookContextPhase, HookHandler, HookType, JsonObject, JsonValue, ListQueryFilterContext, ListQueryWhere, MAX_EMAIL_PROVIDER_TYPE_LENGTH, MediaEventName, MediaEvents, Middleware, NavCollectionItem, NavFilterContext, NextlyError, PLUGIN_CATEGORIES, PaginatedResult, PermissionSlug, PluginActionRegistry, PluginAdminContributions, PluginAdminPage, PluginAdminWidget, PluginCategory, PluginCollectionService, PluginCollectionView, PluginContext, PluginContributions, PluginDataFieldConfig, PluginDeclaration, PluginDefinition, PluginEmailProvider, PluginEmailTemplate, PluginFieldCodegen, PluginFieldCodegenImport, PluginFieldInput, PluginFieldInstance, PluginFieldIssue, PluginFieldType, PluginFieldValidateArgs, PluginFieldValidationResult, PluginFilterRegistry, PluginHookRegistry, PluginMenuItem, PluginPermission, PluginRole, PluginRoute, PluginRouteContext, PluginRouteHandler, QueryOptions, RegisteredEmailProvider, RequestContext, RouteMethod, ScheduledTask, ServiceOpts, ValidateFieldValuesOptions, ValidationIssue, checkbox, defineEmailProvider, definePlugin, group, isPluginCategory, pluginAdminSlug, pluginField, text, textarea, upload, validateFieldValues } from 'nextly';
1
+ export { Action, AddressableField, AddressableFieldsOptions, AuthEventName, AuthEvents, AuthHookName, AuthHooks, AuthInput, AuthOutcome, AuthStrategy, AuthUser, AuthorableFieldConfig, AuthoredDraftSplitCollection, BatchOperationResult, BeforeOperationArgs, BeforeOperationContext, BeforeOperationHandler, Challenge, ChallengeDefinition, ComponentPath, CoreFilterSeam, DocumentEventName, DocumentEvents, DraftSplitDisabledReason, DraftSplitEligibility, EmailAfterSendValue, EmailFilterContext, EmailPayloadFilterValue, EmailProviderCapabilities, EmailProviderConfigField, EmailProviderDefinition, EmailProviderDescriptor, EventBus, EventEnvelope, EventHandler, EventName, FieldAdminOptions, FieldConfig, FieldValueDeclaration, FieldValueDeclarationInput, Filter, FilterSeams, HookContext, HookContextPhase, HookHandler, HookType, JobContext, JobDefinition, JobDefinitionInput, JobInputFor, JobRetryPolicy, JobSlug, JsonObject, JsonValue, ListQueryFilterContext, ListQueryWhere, MAX_EMAIL_PROVIDER_TYPE_LENGTH, MAX_JOB_SLUG_LENGTH, MediaEventName, MediaEvents, Middleware, NavCollectionItem, NavFilterContext, NextlyError, PLUGIN_CATEGORIES, PaginatedResult, PermissionSlug, PluginActionRegistry, PluginAdminContributions, PluginAdminPage, PluginAdminWidget, PluginCategory, PluginCollectionService, PluginCollectionView, PluginContext, PluginContributions, PluginDataFieldConfig, PluginDeclaration, PluginDefinition, PluginEmailProvider, PluginEmailTemplate, PluginFieldCodegen, PluginFieldCodegenImport, PluginFieldInput, PluginFieldInstance, PluginFieldIssue, PluginFieldType, PluginFieldValidateArgs, PluginFieldValidationResult, PluginFilterRegistry, PluginHookRegistry, PluginMenuItem, PluginNavSection, PluginPermission, PluginRole, PluginRoute, PluginRouteContext, PluginRouteHandler, PluginSingleRecord, PluginSinglesResult, PluginSinglesService, ProviderAvailability, QueryOptions, QueueJobArgs, QueueJobResult, RegisteredEmailProvider, RequestContext, ResolvedDraftSplitCollection, RouteMethod, ScheduledTask, SerializedFieldConfig, ServiceOpts, UnvalidatedAddressableField, ValidateFieldValuesOptions, ValidationIssue, WIDGET_ARCHETYPES, WIDGET_HEIGHTS, WIDGET_OPS, WIDGET_SIZES, WIDGET_SOURCE_FIELD_TYPES, WIDGET_SOURCE_KINDS, WidgetArchetype, WidgetDefinition, WidgetHeight, WidgetOp, WidgetQuery, WidgetSize, WidgetSource, WidgetSourceField, WidgetSourceFieldType, WidgetSourceKind, addressableFields, checkbox, collectionDraftSplit, defineEmailProvider, defineJob, definePlugin, group, isPluginCategory, pluginAdminSlug, pluginField, registerSource, registerWidget, resolvedCollectionDraftSplit, resolvedCollectionView, text, textarea, upload, validateFieldValues } from 'nextly';
2
2
 
3
3
  /**
4
4
  * @experimental A secret value that auto-redacts at every common leak vector —
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { AuthEvents, DocumentEvents, FilterSeams, MAX_EMAIL_PROVIDER_TYPE_LENGTH, MediaEvents, NextlyError, PLUGIN_CATEGORIES, checkbox, defineEmailProvider, definePlugin, group, isPluginCategory, pluginAdminSlug, pluginField, text, textarea, upload, validateFieldValues } from 'nextly';
1
+ export { AuthEvents, DocumentEvents, FilterSeams, MAX_EMAIL_PROVIDER_TYPE_LENGTH, MAX_JOB_SLUG_LENGTH, MediaEvents, NextlyError, PLUGIN_CATEGORIES, WIDGET_ARCHETYPES, WIDGET_HEIGHTS, WIDGET_OPS, WIDGET_SIZES, WIDGET_SOURCE_FIELD_TYPES, WIDGET_SOURCE_KINDS, addressableFields, checkbox, collectionDraftSplit, defineEmailProvider, defineJob, definePlugin, group, isPluginCategory, pluginAdminSlug, pluginField, registerSource, registerWidget, resolvedCollectionDraftSplit, resolvedCollectionView, text, textarea, upload, validateFieldValues } from 'nextly';
2
2
 
3
3
  // src/index.ts
4
4
 
@@ -0,0 +1 @@
1
+ export { slugToStaticParam } from 'nextly/runtime';
@@ -0,0 +1,3 @@
1
+ export { slugToStaticParam } from 'nextly/runtime';
2
+ //# sourceMappingURL=routing.mjs.map
3
+ //# sourceMappingURL=routing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"routing.mjs","sourcesContent":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextlyhq/plugin-sdk",
3
- "version": "0.0.2-alpha.58",
3
+ "version": "0.0.2-alpha.62",
4
4
  "description": "Nextly Plugin SDK — the author-facing surface for building Nextly plugins; the plugin API stability boundary (see STABILITY.md).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,6 +41,11 @@
41
41
  "types": "./dist/admin.d.ts",
42
42
  "import": "./dist/admin.mjs",
43
43
  "default": "./dist/admin.mjs"
44
+ },
45
+ "./routing": {
46
+ "types": "./dist/routing.d.ts",
47
+ "import": "./dist/routing.mjs",
48
+ "default": "./dist/routing.mjs"
44
49
  }
45
50
  },
46
51
  "files": [
@@ -50,13 +55,13 @@
50
55
  "node": "^20.19.0 || ^22.12.0 || >=24.0.0"
51
56
  },
52
57
  "dependencies": {
53
- "@nextlyhq/blocks-engine": "0.0.2-alpha.58"
58
+ "@nextlyhq/blocks-engine": "0.0.2-alpha.62"
54
59
  },
55
60
  "peerDependencies": {
56
61
  "react": "^18.0.0 || ^19.0.0",
57
62
  "react-dom": "^18.0.0 || ^19.0.0",
58
- "@nextlyhq/admin": "0.0.2-alpha.58",
59
- "nextly": "0.0.2-alpha.58"
63
+ "@nextlyhq/admin": "0.0.2-alpha.62",
64
+ "nextly": "0.0.2-alpha.62"
60
65
  },
61
66
  "peerDependenciesMeta": {
62
67
  "@nextlyhq/admin": {
@@ -77,10 +82,10 @@
77
82
  "tsup": "^8.5.0",
78
83
  "typescript": "^5.9.3",
79
84
  "vitest": "^4.1.0",
80
- "@nextlyhq/admin": "0.0.2-alpha.58",
81
- "@nextlyhq/eslint-config": "0.0.2-alpha.58",
82
- "@nextlyhq/tsconfig": "0.0.2-alpha.58",
83
- "nextly": "0.0.2-alpha.58"
85
+ "@nextlyhq/admin": "0.0.2-alpha.62",
86
+ "@nextlyhq/eslint-config": "0.0.2-alpha.62",
87
+ "@nextlyhq/tsconfig": "0.0.2-alpha.62",
88
+ "nextly": "0.0.2-alpha.62"
84
89
  },
85
90
  "publishConfig": {
86
91
  "access": "public",