@nextlyhq/plugin-sdk 0.0.2-alpha.73 → 0.0.2-alpha.74
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 +4 -3
- package/dist/admin.mjs +3 -1
- package/dist/blocks.d.ts +4 -2
- package/dist/blocks.mjs +2 -1
- package/dist/blocks.mjs.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.mjs +5 -2
- package/dist/index.mjs.map +1 -1
- package/dist/routing.d.ts +2 -2
- package/dist/routing.mjs +1 -1
- package/package.json +8 -8
package/dist/admin.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { JsonObject, JsonValue, PluginAdminContributions, PluginAdminPage, PluginCollectionView, PluginDocumentView, PluginFieldTypeDocumentView, PluginMenuItem } from "nextly";
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { JsonObject, JsonValue, OverridableDocumentAction, PluginAdminContributions, PluginAdminPage, PluginCollectionView, PluginDocumentActionOverride, PluginDocumentActionOverrides, PluginDocumentView, PluginFieldTypeDocumentView, PluginMenuItem, PluginPanelSection } from "nextly";
|
|
2
|
+
import { WEB_FONT_FORMATS } from "nextly/config";
|
|
3
|
+
import { ActionGroup, ActionPlacement, AdminChromeLayer, ApiError, AutosaveStatus, BeforeDocumentAction, BulkAction, Button, Card, CardAction, CardContent, CardDescription, CardEmptyContent, CardFooter, CardHeader, CardProps, CardState, CardTitle, CellContext, CellRenderer, CellRendererDefinition, ChallengeResolveResult, ChallengeViewProps, Checkbox, ColumnProvider, ColumnTransform, ComponentPath, ConditionOperatorName, ConditionRange, ConditionRow, ConditionRowProps, ConditionSource, ConditionSourceOption, ConditionValue, CustomEditViewProps, DataTable, DataTableContext, DataTableProps, DataTableSelection, DataTableTarget, DataTableView, DataTableViewProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DocumentAction, DocumentActionOutcome, DocumentActionReplacementProps, DocumentActions, DocumentChangeResult, DocumentIdentity, DocumentLocale, DocumentLockGates, DocumentPanelSectionProps, DocumentPreview, DocumentPrimaryAction, DocumentRestoreHandler, DocumentSaveIndicator, DocumentSaveState, DocumentStatus, DocumentViewProps, EDITABLE_VALIDATION_RULES, FieldAddress, FieldDefaultOption, FieldDefaultValueInput, FieldDefaultValueInputProps, FieldGroupOption, FieldOption, FieldOptionsEditor, FieldOptionsEditorProps, FieldPicker, FieldPickerChoice, FieldPickerConfig, FieldPickerProps, FieldShell, FieldShellProps, FieldShellRenderProps, FieldTypeDescription, FieldTypePicker, FieldTypePickerProps, FieldWidth, FormActions, FormActionsProps, FormSection, FormSectionProps, FrameState, Grid, GridProps, InlineRichTextAttachment, InlineRichTextEditor, InlineRichTextRefusal, InlineRichTextSession, Input, Label, MediaPickerDialog, MediaPickerDialogProps, NextlyColumn, NextlyFieldSchema, NextlyFieldType, PILL_LABEL, PillState, PluginRouteInvalidation, PluginRouteMethod, PluginRouteRead, PluginRouteRequest, PluginRouteWrite, PluginRouteWriter, RichTextEditorKit, RowAction, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SingleDocument, SkeletonShape, Stack, StackProps, Stat, StatProps, StoreReadiness, SubmitRefusal, Switch, Textarea, UseDocumentCheckpointOptions, UseDocumentCheckpointResult, ValidationIssue, ValidationNumberField, ValidationNumberFieldProps, ValidationRuleValues, ValidationRulesEditor, ValidationRulesEditorProps, Widget, WidgetBarChartGroup, WidgetBarChartProps, WidgetChartUnit, WidgetFigureProps, WidgetListProps, WidgetListTotal, WidgetRenderSize, WidgetRowAction, WidgetSeries, WidgetSeriesChartProps, WidgetSeriesInterval, WidgetSeriesPoint, WidgetTableColumn, WidgetTableProps, apiErrorMessage, describeFieldTypes, drawsAnyValidationRule, formatWidgetTime, humanizeFieldName, isApiError, loadInlineRichTextEditor, loadRichTextEditorKit, navigateWithinAdmin as navigateTo, operatorTakesValue, operatorsForType, pillStateFromForm, readPluginRoute, registerBulkAction, registerCellRenderer, registerColumns, registerComponent, registerComponents, registerKnownPlugin, registerRowAction, toastMutationResult, transformColumns, useBeforeDocumentAction, useCurrentUserId, useDocumentActions, useDocumentCheckpoint, useDocumentIdentity, useDocumentLocale, useDocumentPreview, useDocumentRestore, useDocumentStatus, useEntryFieldsPanel, useFieldAddress, useMediaItem, useMediaResolver, useMediaSearcher, usePluginClientConfig, usePluginFieldTypeEntries, usePluginRoute, usePluginRouteMutation, usePluginTranslate, useRefreshDashboard, useReportUnsavedWork, useSingleDocument, useSuppressAdminChrome, useTrackedWrite, useUpdateSingleDocument, useUploadMedia, useWidgetClock, validationIssues, withOptionIds, writePluginRoute } from "@nextlyhq/admin";
|
|
4
|
+
export { type ActionGroup, type ActionPlacement, type AdminChromeLayer, type ApiError, type AutosaveStatus, type BeforeDocumentAction, type BulkAction, Button, Card, CardAction, CardContent, CardDescription, type CardEmptyContent, CardFooter, CardHeader, type CardProps, type CardState, CardTitle, type CellContext, type CellRenderer, type CellRendererDefinition, type ChallengeResolveResult, type ChallengeViewProps, Checkbox, type ColumnProvider, type ColumnTransform, type ComponentPath, type ConditionOperatorName, type ConditionRange, ConditionRow, type ConditionRowProps, type ConditionSource, type ConditionSourceOption, type ConditionValue, type CustomEditViewProps, DataTable, type DataTableContext, type DataTableProps, type DataTableSelection, type DataTableTarget, DataTableView, type DataTableViewProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, type DocumentAction, type DocumentActionOutcome, type DocumentActionReplacementProps, type DocumentActions, type DocumentChangeResult, type DocumentIdentity, type DocumentLocale, type DocumentLockGates, type DocumentPanelSectionProps, type DocumentPreview, DocumentPrimaryAction, type DocumentRestoreHandler, DocumentSaveIndicator, type DocumentSaveState, type DocumentStatus, type DocumentViewProps, EDITABLE_VALIDATION_RULES, type FieldAddress, type FieldDefaultOption, FieldDefaultValueInput, type FieldDefaultValueInputProps, type FieldGroupOption, type FieldOption, FieldOptionsEditor, type FieldOptionsEditorProps, FieldPicker, type FieldPickerChoice, type FieldPickerConfig, type FieldPickerProps, FieldShell, type FieldShellProps, type FieldShellRenderProps, type FieldTypeDescription, FieldTypePicker, type FieldTypePickerProps, type FieldWidth, FormActions, type FormActionsProps, FormSection, type FormSectionProps, FrameState, Grid, type GridProps, type InlineRichTextAttachment, type InlineRichTextEditor, type InlineRichTextRefusal, type InlineRichTextSession, Input, type JsonObject, type JsonValue, Label, MediaPickerDialog, type MediaPickerDialogProps, type NextlyColumn, type NextlyFieldSchema, type NextlyFieldType, type OverridableDocumentAction, PILL_LABEL, type PillState, type PluginAdminContributions, type PluginAdminPage, type PluginCollectionView, type PluginDocumentActionOverride, type PluginDocumentActionOverrides, type PluginDocumentView, type PluginFieldTypeDocumentView, type PluginMenuItem, type PluginPanelSection, type PluginRouteInvalidation, type PluginRouteMethod, type PluginRouteRead, type PluginRouteRequest, type PluginRouteWrite, type PluginRouteWriter, type RichTextEditorKit, type RowAction, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, type SingleDocument, type SkeletonShape, Stack, type StackProps, Stat, type StatProps, type StoreReadiness, type SubmitRefusal, Switch, Textarea, type UseDocumentCheckpointOptions, type UseDocumentCheckpointResult, type ValidationIssue, ValidationNumberField, type ValidationNumberFieldProps, type ValidationRuleValues, ValidationRulesEditor, type ValidationRulesEditorProps, WEB_FONT_FORMATS, Widget, type WidgetBarChartGroup, type WidgetBarChartProps, type WidgetChartUnit, type WidgetFigureProps, type WidgetListProps, type WidgetListTotal, type WidgetRenderSize, type WidgetRowAction, type WidgetSeries, type WidgetSeriesChartProps, type WidgetSeriesInterval, type WidgetSeriesPoint, type WidgetTableColumn, type WidgetTableProps, apiErrorMessage, describeFieldTypes, drawsAnyValidationRule, formatWidgetTime, humanizeFieldName, isApiError, loadInlineRichTextEditor, loadRichTextEditorKit, navigateTo, operatorTakesValue, operatorsForType, pillStateFromForm, readPluginRoute, registerBulkAction, registerCellRenderer, registerColumns, registerComponent, registerComponents, registerKnownPlugin, registerRowAction, toastMutationResult, transformColumns, useBeforeDocumentAction, useCurrentUserId, useDocumentActions, useDocumentCheckpoint, useDocumentIdentity, useDocumentLocale, useDocumentPreview, useDocumentRestore, useDocumentStatus, useEntryFieldsPanel, useFieldAddress, useMediaItem, useMediaResolver, useMediaSearcher, usePluginClientConfig, usePluginFieldTypeEntries, usePluginRoute, usePluginRouteMutation, usePluginTranslate, useRefreshDashboard, useReportUnsavedWork, useSingleDocument, useSuppressAdminChrome, useTrackedWrite, useUpdateSingleDocument, useUploadMedia, useWidgetClock, validationIssues, withOptionIds, writePluginRoute };
|
package/dist/admin.mjs
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { WEB_FONT_FORMATS } from "nextly/config";
|
|
2
|
+
import { Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ConditionRow, DataTable, DataTableView, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DocumentPrimaryAction, DocumentSaveIndicator, EDITABLE_VALIDATION_RULES, FieldDefaultValueInput, FieldOptionsEditor, FieldPicker, FieldShell, FieldTypePicker, FormActions, FormSection, FrameState, Grid, Input, Label, MediaPickerDialog, PILL_LABEL, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Stack, Stat, Switch, Textarea, ValidationNumberField, ValidationRulesEditor, Widget, apiErrorMessage, describeFieldTypes, drawsAnyValidationRule, formatWidgetTime, humanizeFieldName, isApiError, loadInlineRichTextEditor, loadRichTextEditorKit, navigateWithinAdmin as navigateTo, operatorTakesValue, operatorsForType, pillStateFromForm, readPluginRoute, registerBulkAction, registerCellRenderer, registerColumns, registerComponent, registerComponents, registerKnownPlugin, registerRowAction, toastMutationResult, transformColumns, useBeforeDocumentAction, useCurrentUserId, useDocumentActions, useDocumentCheckpoint, useDocumentIdentity, useDocumentLocale, useDocumentPreview, useDocumentRestore, useDocumentStatus, useEntryFieldsPanel, useFieldAddress, useMediaItem, useMediaResolver, useMediaSearcher, usePluginClientConfig, usePluginFieldTypeEntries, usePluginRoute, usePluginRouteMutation, usePluginTranslate, useRefreshDashboard, useReportUnsavedWork, useSingleDocument, useSuppressAdminChrome, useTrackedWrite, useUpdateSingleDocument, useUploadMedia, useWidgetClock, validationIssues, withOptionIds, writePluginRoute } from "@nextlyhq/admin";
|
|
3
|
+
export { Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ConditionRow, DataTable, DataTableView, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DocumentPrimaryAction, DocumentSaveIndicator, EDITABLE_VALIDATION_RULES, FieldDefaultValueInput, FieldOptionsEditor, FieldPicker, FieldShell, FieldTypePicker, FormActions, FormSection, FrameState, Grid, Input, Label, MediaPickerDialog, PILL_LABEL, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Stack, Stat, Switch, Textarea, ValidationNumberField, ValidationRulesEditor, WEB_FONT_FORMATS, Widget, apiErrorMessage, describeFieldTypes, drawsAnyValidationRule, formatWidgetTime, humanizeFieldName, isApiError, loadInlineRichTextEditor, loadRichTextEditorKit, navigateTo, operatorTakesValue, operatorsForType, pillStateFromForm, readPluginRoute, registerBulkAction, registerCellRenderer, registerColumns, registerComponent, registerComponents, registerKnownPlugin, registerRowAction, toastMutationResult, transformColumns, useBeforeDocumentAction, useCurrentUserId, useDocumentActions, useDocumentCheckpoint, useDocumentIdentity, useDocumentLocale, useDocumentPreview, useDocumentRestore, useDocumentStatus, useEntryFieldsPanel, useFieldAddress, useMediaItem, useMediaResolver, useMediaSearcher, usePluginClientConfig, usePluginFieldTypeEntries, usePluginRoute, usePluginRouteMutation, usePluginTranslate, useRefreshDashboard, useReportUnsavedWork, useSingleDocument, useSuppressAdminChrome, useTrackedWrite, useUpdateSingleDocument, useUploadMedia, useWidgetClock, validationIssues, withOptionIds, writePluginRoute };
|
package/dist/blocks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyBlockDefinition, BlockDefinition as BlockDefinition$1, BlockEditorMeta, BlockExample, BlockIcon, BlockInspectorProps, BlockIsland, BlockPart, BlockRenderArgs as BlockRenderArgs$1, BlockSeoContribution, BlockSeoImage, BlockVariation, ComponentPath, InferBlockProps, NodeStyles, PropSchema, SlotLock, SlotSpec, SupportDefinition } from "@nextlyhq/blocks-engine";
|
|
1
|
+
import { AnyBlockDefinition, BlockDefinition as BlockDefinition$1, BlockEditorMeta, BlockExample, BlockIcon, BlockInspectorProps, BlockIsland, BlockPart, BlockRenderArgs as BlockRenderArgs$1, BlockSeoContribution, BlockSeoImage, BlockVariation, BooleanParam, ChoiceParam, ComponentPath, ContentKind, ContentModel, DayParam, EntryParam, InferBlockProps, NamedQueryChoice, NamedQueryDeclaration, NamedQueryDefinition, NamedQueryParam, NamedQueryParamValues, NamedQueryParams, NamedQueryReader, NamedQueryResult, NamedQueryRows, NamedQueryRunArgs, NamedReadFilter, NamedReadQuery, NodeStyles, NumberParam, PropSchema, SlotLock, SlotSpec, SupportDefinition, TextParam, defineNamedQuery, param } from "@nextlyhq/blocks-engine";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* The support keys a block may declare.
|
|
@@ -64,6 +64,8 @@ export interface BlockSupportKeys {
|
|
|
64
64
|
container: never;
|
|
65
65
|
/** Marker style on a list. */
|
|
66
66
|
list: never;
|
|
67
|
+
/** The icon a block's disclosure children show, and which side it sits on. */
|
|
68
|
+
disclosure: never;
|
|
67
69
|
/** Author-written CSS on this block. Gates a capability, not a style group. */
|
|
68
70
|
customCss: never;
|
|
69
71
|
}
|
|
@@ -244,5 +246,5 @@ export declare function blockSupports<S extends BlockSupports>(supports: ExactSu
|
|
|
244
246
|
* @experimental Carried by the same freeze as `defineBlock`.
|
|
245
247
|
*/
|
|
246
248
|
export type BlockRenderResult = ReactNode | Promise<ReactNode>;
|
|
247
|
-
export type
|
|
249
|
+
export { type AnyBlockDefinition, type BlockEditorMeta, type BlockExample, type BlockIcon, type BlockInspectorProps, type BlockIsland, type BlockPart, type BlockSeoContribution, type BlockSeoImage, type BlockVariation, type BooleanParam, type ChoiceParam, type ComponentPath, type ContentKind, type ContentModel, type DayParam, type EntryParam, type InferBlockProps, type NamedQueryChoice, type NamedQueryDeclaration, type NamedQueryDefinition, type NamedQueryParam, type NamedQueryParamValues, type NamedQueryParams, type NamedQueryReader, type NamedQueryResult, type NamedQueryRows, type NamedQueryRunArgs, type NamedReadFilter, type NamedReadQuery, type NodeStyles, type NumberParam, type PropSchema, type SlotLock, type SlotSpec, type SupportDefinition, type TextParam, defineNamedQuery, param };
|
|
248
250
|
//# sourceMappingURL=blocks.d.ts.map
|
package/dist/blocks.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineNamedQuery, param } from "@nextlyhq/blocks-engine";
|
|
1
2
|
// src/blocks.ts
|
|
2
3
|
/**
|
|
3
4
|
* Declare a block.
|
|
@@ -47,6 +48,6 @@ function defineBlock(definition) {
|
|
|
47
48
|
function blockSupports(supports) {
|
|
48
49
|
return supports;
|
|
49
50
|
}
|
|
50
|
-
export { blockSupports, defineBlock };
|
|
51
|
+
export { blockSupports, defineBlock, defineNamedQuery, param };
|
|
51
52
|
|
|
52
53
|
//# sourceMappingURL=blocks.mjs.map
|
package/dist/blocks.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.mjs","names":[],"sources":["../src/blocks.ts"],"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. React admits only\n * `Promise<AwaitedReactNode>`, a promise of a settled node, so a promise that\n * may itself yield a promise is refused. Widening here would move the error\n * onto every block that draws a slot.\n *\n * It still admits a pending slot, because React counts\n * `Promise<AwaitedReactNode>` as a `ReactNode`: a renderer may hand one back\n * and the block places it unchanged.\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`, which admits\n * only a promise of a settled node: an async block's `render` returns a\n * promise of anything it could return synchronously, and spelling it out\n * says so.\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.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport type BlockRenderResult = ReactNode | Promise<ReactNode>;\n\n/**\n * What a block's own inspector (`editor.component`) is given: the selected\n * node, its props, `commit(name, value)` through the editor's own write path,\n * and whether the block is read-only. The editor refuses a commit while it is,\n * and one to a non-content prop inside a `contentOnly` area, whatever the\n * component does.\n *\n * @experimental The contract will grow with the editor's controls registry.\n */\nexport type { BlockInspectorProps } from \"@nextlyhq/blocks-engine\";\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"],"mappings":";;;;;;;;;;;;;;;;;;;AAuQA,SAAgB,YACd,YACoB;CACpB,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgB,cACd,UACe;CACf,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"blocks.mjs","names":[],"sources":["../src/blocks.ts"],"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 /** The icon a block's disclosure children show, and which side it sits on. */\n disclosure: 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. React admits only\n * `Promise<AwaitedReactNode>`, a promise of a settled node, so a promise that\n * may itself yield a promise is refused. Widening here would move the error\n * onto every block that draws a slot.\n *\n * It still admits a pending slot, because React counts\n * `Promise<AwaitedReactNode>` as a `ReactNode`: a renderer may hand one back\n * and the block places it unchanged.\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`, which admits\n * only a promise of a settled node: an async block's `render` returns a\n * promise of anything it could return synchronously, and spelling it out\n * says so.\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.\n *\n * @experimental Carried by the same freeze as `defineBlock`.\n */\nexport type BlockRenderResult = ReactNode | Promise<ReactNode>;\n\n/**\n * What a block's own inspector (`editor.component`) is given: the selected\n * node, its props, `commit(name, value)` through the editor's own write path,\n * and whether the block is read-only. The editor refuses a commit while it is,\n * and one to a non-content prop inside a `contentOnly` area, whatever the\n * component does.\n *\n * @experimental The contract will grow with the editor's controls registry.\n */\nexport type { BlockInspectorProps } from \"@nextlyhq/blocks-engine\";\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 * `ContentKind` and `ContentModel` are what `contentModel(props)` answers\n * with, so a block author declares what their block is as HTML content\n * without importing the engine.\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 ContentKind,\n ContentModel,\n NodeStyles,\n SlotLock,\n SlotSpec,\n} from \"@nextlyhq/blocks-engine\";\n\n/**\n * Named queries: a collection list's custom source. A developer declares one\n * with `defineNamedQuery`, its typed inputs made with `param`, every\n * collection, Single and site setting it reads, and the shape of its rows.\n * The site registers its own with `pageBuilder({ namedQueries })`; a plugin\n * declares them under `contributes.declarations[\"@nextlyhq/plugin-page-builder\"].namedQueries`.\n *\n * Re-exported from the engine, where the validator and the renderer read the\n * same declaration. Its `run` function receives a reader that reads as an\n * anonymous visitor, limited to what the query declares; the Direct API\n * refuses any other read made while it runs.\n *\n * @experimental A collection list's custom source settles with the editor\n * that offers it.\n */\nexport { defineNamedQuery, param } from \"@nextlyhq/blocks-engine\";\n/** @experimental Settles with `defineNamedQuery`. */\nexport type {\n BooleanParam,\n ChoiceParam,\n DayParam,\n EntryParam,\n NamedQueryChoice,\n NamedQueryDeclaration,\n NamedQueryDefinition,\n NamedQueryParam,\n NamedQueryParams,\n NamedQueryParamValues,\n NamedQueryReader,\n NamedQueryResult,\n NamedQueryRows,\n NamedQueryRunArgs,\n NamedReadFilter,\n NamedReadQuery,\n NumberParam,\n TextParam,\n} from \"@nextlyhq/blocks-engine\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyQA,SAAgB,YACd,YACoB;CACpB,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgB,cACd,UACe;CACf,OAAO;AACT"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { Action, AddressableField, AddressableFieldsOptions, AdmittedReservation, AnyWidget, AttentionCount, AttentionItem, AuthEventName, AuthEvents, AuthHookName, AuthHooks, AuthInput, AuthLimitAnswer, AuthOutcome, AuthStrategy, AuthUser, AuthenticatedScope, AuthorableFieldConfig, AuthoredDraftSplitCollection, BatchOperationResult, BeforeOperationArgs, BeforeOperationContext, BeforeOperationHandler, BreachedPasswordsConfig, BulkUpdateEntry, Challenge, ChallengeDefinition, CompleteLoginOptions, ComponentPath, CoreFilterSeam, CoreView, DEFAULT_ADMIN_PATH, Decision, DocumentEventName, DocumentEvents, DraftSplitDisabledReason, DraftSplitEligibility, EmailAfterSendValue, EmailFilterContext, EmailPayloadFilterValue, EmailProviderCapabilities, EmailProviderConfigField, EmailProviderDefinition, EmailProviderDescriptor, EmailTemplateData, EntryVerdict, EventBus, EventEnvelope, EventHandler, EventName, FieldAdminOptions, FieldConfig, FieldValueDeclaration, FieldValueDeclarationInput, Filter, FilterSeams, FrozenCopy, FrozenValue, GrantedPermission, GridSize, HookContext, HookContextPhase, HookHandler, HookPointContext, HookPointNameOf, HookPointPayload, HookPointPayloads, HookPointValue, HookType, JobContext, JobDefinition, JobDefinitionInput, JobInputFor, JobRetryPolicy, JobSlug, JsonObject, JsonValue, LimitCheck, LimitEntry, LimitOutcome, LimitReservation, LimitRule, LimitTarget, ListQueryFilterContext, ListQueryWhere, MAX_ATTENTION_ITEMS_PER_PLUGIN, MAX_EMAIL_PROVIDER_TYPE_LENGTH, MAX_JOB_SLUG_LENGTH, MediaEventName, MediaEvents, Middleware, NavCollectionItem, NavFilterContext, NextlyError, NextlyPrincipals, OneTimeSecrets, OpaqueSecrets, PLUGIN_CATEGORIES, PaginatedResult, PaginationMeta, PasswordCheck, PasswordHelper, PasswordRules, PasswordTooLongError, PermissionSlug, PluginActionRegistry, PluginAdminContributions, PluginAdminPage, PluginAuditApi, PluginAuditDeclaration, PluginAuthApi, PluginCapabilities, PluginCategory, PluginCollectionService, PluginCollectionTransaction, PluginCollectionView, PluginConfig, PluginContext, PluginContributions, PluginDataFieldConfig, PluginDatabase, PluginDeclaration, PluginDefinition, PluginEmailProvider, PluginEmailService, PluginEmailSettings, PluginEmailTemplate, PluginFieldCodegen, PluginFieldCodegenImport, PluginFieldInput, PluginFieldInstance, PluginFieldIssue, PluginFieldType, PluginFieldValidateArgs, PluginFieldValidationResult, PluginFieldWrite, PluginFilterRegistry, PluginHookPointDeclaration, PluginHookRegistry, PluginInsert, PluginLimiter, PluginMediaService, PluginMenuItem, PluginNavSection, PluginPermission, PluginPinOptions, PluginPinTransaction, PluginPrincipalsApi, PluginRawDatabase, PluginRole, PluginRoute, PluginRouteCaller, PluginRouteContext, PluginRouteHandler, PluginRouteIdentity, PluginRouteLimitKey, PluginRouteMount, PluginRoutePermissionResolver, PluginRoutePermissionScope, PluginRoutePrincipal, PluginRouteRateLimit, PluginSecurityApi, PluginSettingsApi, PluginSingleRecord, PluginSinglesResult, PluginSinglesService, PluginStoredValue, PluginStoredValueTarget, PluginSummary, PluginTransaction, PluginUserService, PluginVersionPin, PluginVersionPinHolder, PluginVersionPins, PluginVersionsService, Principal, PrincipalAnswer, PrincipalAttributeDescriptors, PrincipalAttributeType, PrincipalAttributeTypeOf, PrincipalAttributeValue, PrincipalAttributes, PrincipalAttributesOf, PrincipalKindContribution, PrincipalKindDefinition, PrincipalRecord, PrincipalRef, PrincipalReportOptions, ProviderAvailability, QueryOptions, QueueJobArgs, QueueJobResult, ReadCaller, ReadableContent, ReadableContentCaller, ReadableContentEntity, RegisteredEmailProvider, RequestContext, ResolvedDraftSplitCollection, ResolverOptions, RouteMethod, RunAsPrincipal, ScheduledTask, SecretData, SerializedFieldConfig, ServiceOpts, SettingEditorProps, TIMESERIES_INTERVALS, TimeseriesInterval, TrustedHtml, TxOption, UnvalidatedAddressableField, UserCreatedPayload, UserDeletedPayload, UserEventName, UserEvents, ValidateFieldValuesOptions, ValidationIssue, VersionPinHolderDefinition, VersionRef, WIDGET_CONDITIONS, WIDGET_LIFECYCLES, WIDGET_OPS, WIDGET_SOURCE_FIELD_TYPES, WIDGET_SOURCE_KINDS, WidgetAccess, WidgetAccessGate, WidgetCondition, WidgetData, WidgetFieldChoice, WidgetInterval, WidgetLifecycle, WidgetLoadSize, WidgetOp, WidgetPreviewCase, WidgetProps, WidgetQuery, WidgetRange, WidgetReadServices, WidgetRenderSize, WidgetScope, WidgetSetting, WidgetSizeDeclaration, WidgetSource, WidgetSourceField, WidgetSourceFieldType, WidgetSourceKind, WidgetSourceResolver, WidgetSummary, WidgetSummaryCount, WidgetView, addressableFields, callerReadOptions, checkbox, collectDeclarations, collectionDraftSplit, defineAttentionItem, defineEmailProvider, defineJob, definePlugin, defineWidget, getCachedNextly, group, isLocaleSelector, isPluginCategory, isTimeseriesInterval, markHtml, narrowScope, option, pluginAdminSlug, pluginField, readableContent, resolvedCollectionDraftSplit, resolvedCollectionView, respondAction, respondDoc, respondList, respondMutation, routePathIsLiteral, rowsThatFit, sanitizeAdminPath, setting, text, textarea, trustedClientIp, upload, validateFieldValues } from "nextly";
|
|
1
|
+
import { Action, AddressableField, AddressableFieldsOptions, AdminBlockContribution, AdminBulkActionContribution, AdminColumnContribution, AdminContribution, AdminContributionAction, AdminContributionKind, AdminPlaceId, AdminPlaces, AdminRowActionContribution, AdminSidebarSectionContribution, AdminTabContribution, AdmittedReservation, AdvisoryNotice, AnyWidget, AttentionCount, AttentionItem, AuthEventName, AuthEvents, AuthHookName, AuthHooks, AuthInput, AuthLimitAnswer, AuthOutcome, AuthStrategy, AuthUser, AuthenticatedScope, AuthorableFieldConfig, AuthoredDraftSplitCollection, BatchOperationResult, BeforeOperationArgs, BeforeOperationContext, BeforeOperationHandler, BreachedPasswordsConfig, BulkUpdateEntry, CORE_ADMIN_PLACES, Challenge, ChallengeDefinition, CompleteLoginOptions, ComponentPath, CoreAdminPlaceId, CoreFilterSeam, CoreView, DEFAULT_ADMIN_PATH, Decision, DocumentEventName, DocumentEvents, DraftSplitDisabledReason, DraftSplitEligibility, EmailAfterSendValue, EmailFilterContext, EmailPayloadFilterValue, EmailProviderCapabilities, EmailProviderConfigField, EmailProviderDefinition, EmailProviderDescriptor, EmailTemplateData, EntryVerdict, EventBus, EventEnvelope, EventHandler, EventName, FieldAdminOptions, FieldConfig, FieldValueDeclaration, FieldValueDeclarationInput, Filter, FilterSeams, FrozenCopy, FrozenValue, GrantedPermission, GridSize, HookContext, HookContextPhase, HookHandler, HookPointContext, HookPointNameOf, HookPointPayload, HookPointPayloads, HookPointValue, HookType, InTransactionContext, InTransactionHandler, InboundWebhookDelivery, InboundWebhookReading, InboundWebhookScheme, JobContext, JobDefinition, JobDefinitionInput, JobInputFor, JobRetryPolicy, JobSlug, JsonObject, JsonValue, LimitCheck, LimitEntry, LimitOutcome, LimitReservation, LimitRule, LimitTarget, ListQueryFilterContext, ListQueryWhere, MAX_ATTENTION_ITEMS_PER_PLUGIN, MAX_EMAIL_PROVIDER_TYPE_LENGTH, MAX_JOB_SLUG_LENGTH, MediaEventName, MediaEvents, Middleware, NavCollectionItem, NavFilterContext, NextlyError, NextlyPrincipals, OneTimeSecrets, OpaqueSecrets, OverridableDocumentAction, PLUGIN_CATEGORIES, PaginatedResult, PaginationMeta, PasswordCheck, PasswordHelper, PasswordRules, PasswordTooLongError, PermissionSlug, PluginActionRegistry, PluginAdminContributions, PluginAdminPage, PluginAdminPlaceDeclaration, PluginAuditApi, PluginAuditDeclaration, PluginAuthApi, PluginCapabilities, PluginCategory, PluginCollectionService, PluginCollectionTransaction, PluginCollectionView, PluginConditionalUpdate, PluginConditionalWriteIdentity, PluginConfig, PluginContext, PluginContributions, PluginDataFieldConfig, PluginDatabase, PluginDeclaration, PluginDefinition, PluginDeleteCheck, PluginDocumentActionOverride, PluginDocumentActionOverrides, PluginEmailProvider, PluginEmailService, PluginEmailSettings, PluginEmailTemplate, PluginFieldCodegen, PluginFieldCodegenImport, PluginFieldInput, PluginFieldInstance, PluginFieldIssue, PluginFieldType, PluginFieldValidateArgs, PluginFieldValidationResult, PluginFieldWrite, PluginFilterRegistry, PluginHookPointDeclaration, PluginHookRegistry, PluginInsert, PluginJobsNamespace, PluginLimiter, PluginListFilterDeclaration, PluginListFilterOption, PluginMediaService, PluginMenuItem, PluginNavSection, PluginPanelSection, PluginPermission, PluginPinOptions, PluginPinTransaction, PluginPrincipalsApi, PluginRawDatabase, PluginReceivedWebhooks, PluginRole, PluginRoute, PluginRouteCaller, PluginRouteCanOptions, PluginRouteContext, PluginRouteHandler, PluginRouteIdentity, PluginRouteLimitKey, PluginRouteMount, PluginRoutePermissionResolver, PluginRoutePermissionScope, PluginRoutePrincipal, PluginRouteRateLimit, PluginSchedule, PluginSecurityApi, PluginSettingsApi, PluginSingleRecord, PluginSinglesResult, PluginSinglesService, PluginStoredDocument, PluginStoredFields, PluginStoredFieldsRequest, PluginStoredIdentity, PluginStoredLifecycle, PluginStoredValue, PluginStoredValueTarget, PluginSummary, PluginSystemCheckedWrite, PluginSystemIdentity, PluginTransaction, PluginTranslations, PluginUserService, PluginVersionPin, PluginVersionPinHolder, PluginVersionPins, PluginVersionsService, PluginWebhookEventType, PluginWriteCheck, PluginWriteExpectation, Principal, PrincipalAnswer, PrincipalAttributeDescriptors, PrincipalAttributeType, PrincipalAttributeTypeOf, PrincipalAttributeValue, PrincipalAttributes, PrincipalAttributesOf, PrincipalKindContribution, PrincipalKindDefinition, PrincipalRecord, PrincipalRef, PrincipalReportOptions, ProviderAvailability, QueryOptions, QueueJobArgs, QueueJobResult, ReadCaller, ReadableContent, ReadableContentCaller, ReadableContentEntity, RegisteredEmailProvider, RequestContext, ResolvedDraftSplitCollection, ResolverOptions, RouteMethod, RowPredicate, RowPredicateValue, RunAsPrincipal, ScheduledTask, SecretData, SerializedFieldConfig, ServiceOpts, SettingEditorProps, TIMESERIES_INTERVALS, TimeseriesInterval, TrustedHtml, TxOption, UnvalidatedAddressableField, UserCreatedPayload, UserDeletedPayload, UserEventName, UserEvents, ValidateFieldValuesOptions, ValidationIssue, VerifyWebhookOptions, VersionPinHolderDefinition, VersionRef, WIDGET_CONDITIONS, WIDGET_LIFECYCLES, WIDGET_OPS, WIDGET_SOURCE_FIELD_TYPES, WIDGET_SOURCE_KINDS, WebhookRefusal, WebhookVerification, WidgetAccess, WidgetAccessGate, WidgetCondition, WidgetData, WidgetFieldChoice, WidgetInterval, WidgetLifecycle, WidgetLoadSize, WidgetOp, WidgetPreviewCase, WidgetProps, WidgetQuery, WidgetRange, WidgetReadServices, WidgetRenderSize, WidgetScope, WidgetSetting, WidgetSizeDeclaration, WidgetSource, WidgetSourceField, WidgetSourceFieldType, WidgetSourceKind, WidgetSourceResolver, WidgetSummary, WidgetSummaryCount, WidgetView, addressableFields, callerReadOptions, checkbox, collectDeclarations, collectionDraftSplit, defineAttentionItem, defineEmailProvider, defineJob, definePlugin, defineWidget, getCachedNextly, group, isLocaleSelector, isPluginCategory, isTimeseriesInterval, markHtml, mayDeleteEntry, mayWriteEntry, narrowScope, option, pluginAdminSlug, pluginField, readStoredFields, readableContent, recordAdvisoryNotice, resolvedCollectionDraftSplit, resolvedCollectionView, respondAction, respondDoc, respondList, respondMutation, routePathIsLiteral, rowsThatFit, sanitizeAdminPath, setting, standardWebhooks, storedValueHash, text, textarea, trustedClientIp, updateIfUnchanged, upload, validateFieldValues } from "nextly";
|
|
2
2
|
import { ChartSlot as WidgetChartSlot, chartColour as widgetChartColour, formatChange as formatWidgetChange, formatCount as formatWidgetNumber } from "@nextlyhq/ui/format";
|
|
3
|
+
import { previewUrlFromTemplate, readableTitleText } from "nextly/config";
|
|
4
|
+
import { humanizeFieldName } from "nextly/field-label";
|
|
5
|
+
import { PENDING_CHANGE_KEY } from "nextly/reserved-filter-keys";
|
|
3
6
|
/**
|
|
4
7
|
* @experimental A secret value that auto-redacts at every common leak vector —
|
|
5
8
|
* `JSON.stringify` (`toJSON`), `String()`/template interpolation (`toString`),
|
|
@@ -19,5 +22,5 @@ export declare class Secret<T = string> {
|
|
|
19
22
|
export declare function secret<T>(value: T): Secret<T>;
|
|
20
23
|
/** @experimental True if `value` is a {@link Secret}. */
|
|
21
24
|
export declare function isSecret(value: unknown): value is Secret<unknown>;
|
|
22
|
-
export { type Action, type AddressableField, type AddressableFieldsOptions, type AdmittedReservation, type AnyWidget, type AttentionCount, type AttentionItem, type AuthEventName, AuthEvents, type AuthHookName, type AuthHooks, type AuthInput, type AuthLimitAnswer, type AuthOutcome, type AuthStrategy, type AuthUser, type AuthenticatedScope, type AuthorableFieldConfig, type AuthoredDraftSplitCollection, type BatchOperationResult, type BeforeOperationArgs, type BeforeOperationContext, type BeforeOperationHandler, type BreachedPasswordsConfig, type BulkUpdateEntry, type Challenge, type ChallengeDefinition, type CompleteLoginOptions, type ComponentPath, type CoreFilterSeam, type CoreView, DEFAULT_ADMIN_PATH, type Decision, type DocumentEventName, DocumentEvents, type DraftSplitDisabledReason, type DraftSplitEligibility, type EmailAfterSendValue, type EmailFilterContext, type EmailPayloadFilterValue, type EmailProviderCapabilities, type EmailProviderConfigField, type EmailProviderDefinition, type EmailProviderDescriptor, type EmailTemplateData, type EntryVerdict, type EventBus, type EventEnvelope, type EventHandler, type EventName, type FieldAdminOptions, type FieldConfig, type FieldValueDeclaration, type FieldValueDeclarationInput, type Filter, FilterSeams, type FrozenCopy, type FrozenValue, type GrantedPermission, type GridSize, type HookContext, type HookContextPhase, type HookHandler, type HookPointContext, type HookPointNameOf, type HookPointPayload, type HookPointPayloads, type HookPointValue, type HookType, type JobContext, type JobDefinition, type JobDefinitionInput, type JobInputFor, type JobRetryPolicy, type JobSlug, type JsonObject, type JsonValue, type LimitCheck, type LimitEntry, type LimitOutcome, type LimitReservation, type LimitRule, type LimitTarget, type ListQueryFilterContext, type ListQueryWhere, MAX_ATTENTION_ITEMS_PER_PLUGIN, MAX_EMAIL_PROVIDER_TYPE_LENGTH, MAX_JOB_SLUG_LENGTH, type MediaEventName, MediaEvents, type Middleware, type NavCollectionItem, type NavFilterContext, NextlyError, type NextlyPrincipals, type OneTimeSecrets, type OpaqueSecrets, PLUGIN_CATEGORIES, type PaginatedResult, type PaginationMeta, type PasswordCheck, type PasswordHelper, type PasswordRules, PasswordTooLongError, type PermissionSlug, type PluginActionRegistry, type PluginAdminContributions, type PluginAdminPage, type PluginAuditApi, type PluginAuditDeclaration, type PluginAuthApi, type PluginCapabilities, type PluginCategory, type PluginCollectionService, type PluginCollectionTransaction, type PluginCollectionView, type PluginConfig, type PluginContext, type PluginContributions, type PluginDataFieldConfig, type PluginDatabase, type PluginDeclaration, type PluginDefinition, type PluginEmailProvider, type PluginEmailService, type PluginEmailSettings, type PluginEmailTemplate, type PluginFieldCodegen, type PluginFieldCodegenImport, type PluginFieldInput, type PluginFieldInstance, type PluginFieldIssue, type PluginFieldType, type PluginFieldValidateArgs, type PluginFieldValidationResult, type PluginFieldWrite, type PluginFilterRegistry, type PluginHookPointDeclaration, type PluginHookRegistry, type PluginInsert, type PluginLimiter, type PluginMediaService, type PluginMenuItem, type PluginNavSection, type PluginPermission, type PluginPinOptions, type PluginPinTransaction, type PluginPrincipalsApi, type PluginRawDatabase, type PluginRole, type PluginRoute, type PluginRouteCaller, type PluginRouteContext, type PluginRouteHandler, type PluginRouteIdentity, type PluginRouteLimitKey, type PluginRouteMount, type PluginRoutePermissionResolver, type PluginRoutePermissionScope, type PluginRoutePrincipal, type PluginRouteRateLimit, type PluginSecurityApi, type PluginSettingsApi, type PluginSingleRecord, type PluginSinglesResult, type PluginSinglesService, type PluginStoredValue, type PluginStoredValueTarget, type PluginSummary, type PluginTransaction, type PluginUserService, type PluginVersionPin, type PluginVersionPinHolder, type PluginVersionPins, type PluginVersionsService, type Principal, type PrincipalAnswer, type PrincipalAttributeDescriptors, type PrincipalAttributeType, type PrincipalAttributeTypeOf, type PrincipalAttributeValue, type PrincipalAttributes, type PrincipalAttributesOf, type PrincipalKindContribution, type PrincipalKindDefinition, type PrincipalRecord, type PrincipalRef, type PrincipalReportOptions, type ProviderAvailability, type QueryOptions, type QueueJobArgs, type QueueJobResult, type ReadCaller, type ReadableContent, type ReadableContentCaller, type ReadableContentEntity, type RegisteredEmailProvider, type RequestContext, type ResolvedDraftSplitCollection, type ResolverOptions, type RouteMethod, type RunAsPrincipal, type ScheduledTask, type SecretData, type SerializedFieldConfig, type ServiceOpts, type SettingEditorProps, TIMESERIES_INTERVALS, type TimeseriesInterval, TrustedHtml, type TxOption, type UnvalidatedAddressableField, type UserCreatedPayload, type UserDeletedPayload, type UserEventName, UserEvents, type ValidateFieldValuesOptions, type ValidationIssue, type VersionPinHolderDefinition, type VersionRef, WIDGET_CONDITIONS, WIDGET_LIFECYCLES, WIDGET_OPS, WIDGET_SOURCE_FIELD_TYPES, WIDGET_SOURCE_KINDS, type WidgetAccess, type WidgetAccessGate, type WidgetChartSlot, type WidgetCondition, type WidgetData, type WidgetFieldChoice, type WidgetInterval, type WidgetLifecycle, type WidgetLoadSize, type WidgetOp, type WidgetPreviewCase, type WidgetProps, type WidgetQuery, type WidgetRange, type WidgetReadServices, type WidgetRenderSize, type WidgetScope, type WidgetSetting, type WidgetSizeDeclaration, type WidgetSource, type WidgetSourceField, type WidgetSourceFieldType, type WidgetSourceKind, type WidgetSourceResolver, type WidgetSummary, type WidgetSummaryCount, type WidgetView, addressableFields, callerReadOptions, checkbox, collectDeclarations, collectionDraftSplit, defineAttentionItem, defineEmailProvider, defineJob, definePlugin, defineWidget, formatWidgetChange, formatWidgetNumber, getCachedNextly, group, isLocaleSelector, isPluginCategory, isTimeseriesInterval, markHtml, narrowScope, option, pluginAdminSlug, pluginField, readableContent, resolvedCollectionDraftSplit, resolvedCollectionView, respondAction, respondDoc, respondList, respondMutation, routePathIsLiteral, rowsThatFit, sanitizeAdminPath, setting, text, textarea, trustedClientIp, upload, validateFieldValues, widgetChartColour };
|
|
25
|
+
export { type Action, type AddressableField, type AddressableFieldsOptions, type AdminBlockContribution, type AdminBulkActionContribution, type AdminColumnContribution, type AdminContribution, type AdminContributionAction, type AdminContributionKind, type AdminPlaceId, type AdminPlaces, type AdminRowActionContribution, type AdminSidebarSectionContribution, type AdminTabContribution, type AdmittedReservation, type AdvisoryNotice, type AnyWidget, type AttentionCount, type AttentionItem, type AuthEventName, AuthEvents, type AuthHookName, type AuthHooks, type AuthInput, type AuthLimitAnswer, type AuthOutcome, type AuthStrategy, type AuthUser, type AuthenticatedScope, type AuthorableFieldConfig, type AuthoredDraftSplitCollection, type BatchOperationResult, type BeforeOperationArgs, type BeforeOperationContext, type BeforeOperationHandler, type BreachedPasswordsConfig, type BulkUpdateEntry, CORE_ADMIN_PLACES, type Challenge, type ChallengeDefinition, type CompleteLoginOptions, type ComponentPath, type CoreAdminPlaceId, type CoreFilterSeam, type CoreView, DEFAULT_ADMIN_PATH, type Decision, type DocumentEventName, DocumentEvents, type DraftSplitDisabledReason, type DraftSplitEligibility, type EmailAfterSendValue, type EmailFilterContext, type EmailPayloadFilterValue, type EmailProviderCapabilities, type EmailProviderConfigField, type EmailProviderDefinition, type EmailProviderDescriptor, type EmailTemplateData, type EntryVerdict, type EventBus, type EventEnvelope, type EventHandler, type EventName, type FieldAdminOptions, type FieldConfig, type FieldValueDeclaration, type FieldValueDeclarationInput, type Filter, FilterSeams, type FrozenCopy, type FrozenValue, type GrantedPermission, type GridSize, type HookContext, type HookContextPhase, type HookHandler, type HookPointContext, type HookPointNameOf, type HookPointPayload, type HookPointPayloads, type HookPointValue, type HookType, type InTransactionContext, type InTransactionHandler, type InboundWebhookDelivery, type InboundWebhookReading, type InboundWebhookScheme, type JobContext, type JobDefinition, type JobDefinitionInput, type JobInputFor, type JobRetryPolicy, type JobSlug, type JsonObject, type JsonValue, type LimitCheck, type LimitEntry, type LimitOutcome, type LimitReservation, type LimitRule, type LimitTarget, type ListQueryFilterContext, type ListQueryWhere, MAX_ATTENTION_ITEMS_PER_PLUGIN, MAX_EMAIL_PROVIDER_TYPE_LENGTH, MAX_JOB_SLUG_LENGTH, type MediaEventName, MediaEvents, type Middleware, type NavCollectionItem, type NavFilterContext, NextlyError, type NextlyPrincipals, type OneTimeSecrets, type OpaqueSecrets, type OverridableDocumentAction, PENDING_CHANGE_KEY, PLUGIN_CATEGORIES, type PaginatedResult, type PaginationMeta, type PasswordCheck, type PasswordHelper, type PasswordRules, PasswordTooLongError, type PermissionSlug, type PluginActionRegistry, type PluginAdminContributions, type PluginAdminPage, type PluginAdminPlaceDeclaration, type PluginAuditApi, type PluginAuditDeclaration, type PluginAuthApi, type PluginCapabilities, type PluginCategory, type PluginCollectionService, type PluginCollectionTransaction, type PluginCollectionView, type PluginConditionalUpdate, type PluginConditionalWriteIdentity, type PluginConfig, type PluginContext, type PluginContributions, type PluginDataFieldConfig, type PluginDatabase, type PluginDeclaration, type PluginDefinition, type PluginDeleteCheck, type PluginDocumentActionOverride, type PluginDocumentActionOverrides, type PluginEmailProvider, type PluginEmailService, type PluginEmailSettings, type PluginEmailTemplate, type PluginFieldCodegen, type PluginFieldCodegenImport, type PluginFieldInput, type PluginFieldInstance, type PluginFieldIssue, type PluginFieldType, type PluginFieldValidateArgs, type PluginFieldValidationResult, type PluginFieldWrite, type PluginFilterRegistry, type PluginHookPointDeclaration, type PluginHookRegistry, type PluginInsert, type PluginJobsNamespace, type PluginLimiter, type PluginListFilterDeclaration, type PluginListFilterOption, type PluginMediaService, type PluginMenuItem, type PluginNavSection, type PluginPanelSection, type PluginPermission, type PluginPinOptions, type PluginPinTransaction, type PluginPrincipalsApi, type PluginRawDatabase, type PluginReceivedWebhooks, type PluginRole, type PluginRoute, type PluginRouteCaller, type PluginRouteCanOptions, type PluginRouteContext, type PluginRouteHandler, type PluginRouteIdentity, type PluginRouteLimitKey, type PluginRouteMount, type PluginRoutePermissionResolver, type PluginRoutePermissionScope, type PluginRoutePrincipal, type PluginRouteRateLimit, type PluginSchedule, type PluginSecurityApi, type PluginSettingsApi, type PluginSingleRecord, type PluginSinglesResult, type PluginSinglesService, type PluginStoredDocument, type PluginStoredFields, type PluginStoredFieldsRequest, type PluginStoredIdentity, type PluginStoredLifecycle, type PluginStoredValue, type PluginStoredValueTarget, type PluginSummary, type PluginSystemCheckedWrite, type PluginSystemIdentity, type PluginTransaction, type PluginTranslations, type PluginUserService, type PluginVersionPin, type PluginVersionPinHolder, type PluginVersionPins, type PluginVersionsService, type PluginWebhookEventType, type PluginWriteCheck, type PluginWriteExpectation, type Principal, type PrincipalAnswer, type PrincipalAttributeDescriptors, type PrincipalAttributeType, type PrincipalAttributeTypeOf, type PrincipalAttributeValue, type PrincipalAttributes, type PrincipalAttributesOf, type PrincipalKindContribution, type PrincipalKindDefinition, type PrincipalRecord, type PrincipalRef, type PrincipalReportOptions, type ProviderAvailability, type QueryOptions, type QueueJobArgs, type QueueJobResult, type ReadCaller, type ReadableContent, type ReadableContentCaller, type ReadableContentEntity, type RegisteredEmailProvider, type RequestContext, type ResolvedDraftSplitCollection, type ResolverOptions, type RouteMethod, type RowPredicate, type RowPredicateValue, type RunAsPrincipal, type ScheduledTask, type SecretData, type SerializedFieldConfig, type ServiceOpts, type SettingEditorProps, TIMESERIES_INTERVALS, type TimeseriesInterval, TrustedHtml, type TxOption, type UnvalidatedAddressableField, type UserCreatedPayload, type UserDeletedPayload, type UserEventName, UserEvents, type ValidateFieldValuesOptions, type ValidationIssue, type VerifyWebhookOptions, type VersionPinHolderDefinition, type VersionRef, WIDGET_CONDITIONS, WIDGET_LIFECYCLES, WIDGET_OPS, WIDGET_SOURCE_FIELD_TYPES, WIDGET_SOURCE_KINDS, type WebhookRefusal, type WebhookVerification, type WidgetAccess, type WidgetAccessGate, type WidgetChartSlot, type WidgetCondition, type WidgetData, type WidgetFieldChoice, type WidgetInterval, type WidgetLifecycle, type WidgetLoadSize, type WidgetOp, type WidgetPreviewCase, type WidgetProps, type WidgetQuery, type WidgetRange, type WidgetReadServices, type WidgetRenderSize, type WidgetScope, type WidgetSetting, type WidgetSizeDeclaration, type WidgetSource, type WidgetSourceField, type WidgetSourceFieldType, type WidgetSourceKind, type WidgetSourceResolver, type WidgetSummary, type WidgetSummaryCount, type WidgetView, addressableFields, callerReadOptions, checkbox, collectDeclarations, collectionDraftSplit, defineAttentionItem, defineEmailProvider, defineJob, definePlugin, defineWidget, formatWidgetChange, formatWidgetNumber, getCachedNextly, group, humanizeFieldName, isLocaleSelector, isPluginCategory, isTimeseriesInterval, markHtml, mayDeleteEntry, mayWriteEntry, narrowScope, option, pluginAdminSlug, pluginField, previewUrlFromTemplate, readStoredFields, readableContent, readableTitleText, recordAdvisoryNotice, resolvedCollectionDraftSplit, resolvedCollectionView, respondAction, respondDoc, respondList, respondMutation, routePathIsLiteral, rowsThatFit, sanitizeAdminPath, setting, standardWebhooks, storedValueHash, text, textarea, trustedClientIp, updateIfUnchanged, upload, validateFieldValues, widgetChartColour };
|
|
23
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { AuthEvents, DEFAULT_ADMIN_PATH, DocumentEvents, FilterSeams, MAX_ATTENTION_ITEMS_PER_PLUGIN, MAX_EMAIL_PROVIDER_TYPE_LENGTH, MAX_JOB_SLUG_LENGTH, MediaEvents, NextlyError, PLUGIN_CATEGORIES, PasswordTooLongError, TIMESERIES_INTERVALS, TrustedHtml, UserEvents, WIDGET_CONDITIONS, WIDGET_LIFECYCLES, WIDGET_OPS, WIDGET_SOURCE_FIELD_TYPES, WIDGET_SOURCE_KINDS, addressableFields, callerReadOptions, checkbox, collectDeclarations, collectionDraftSplit, defineAttentionItem, defineEmailProvider, defineJob, definePlugin, defineWidget, getCachedNextly, group, isLocaleSelector, isPluginCategory, isTimeseriesInterval, markHtml, narrowScope, option, pluginAdminSlug, pluginField, readableContent, resolvedCollectionDraftSplit, resolvedCollectionView, respondAction, respondDoc, respondList, respondMutation, routePathIsLiteral, rowsThatFit, sanitizeAdminPath, setting, text, textarea, trustedClientIp, upload, validateFieldValues } from "nextly";
|
|
1
|
+
import { AuthEvents, CORE_ADMIN_PLACES, DEFAULT_ADMIN_PATH, DocumentEvents, FilterSeams, MAX_ATTENTION_ITEMS_PER_PLUGIN, MAX_EMAIL_PROVIDER_TYPE_LENGTH, MAX_JOB_SLUG_LENGTH, MediaEvents, NextlyError, PLUGIN_CATEGORIES, PasswordTooLongError, TIMESERIES_INTERVALS, TrustedHtml, UserEvents, WIDGET_CONDITIONS, WIDGET_LIFECYCLES, WIDGET_OPS, WIDGET_SOURCE_FIELD_TYPES, WIDGET_SOURCE_KINDS, addressableFields, callerReadOptions, checkbox, collectDeclarations, collectionDraftSplit, defineAttentionItem, defineEmailProvider, defineJob, definePlugin, defineWidget, getCachedNextly, group, isLocaleSelector, isPluginCategory, isTimeseriesInterval, markHtml, mayDeleteEntry, mayWriteEntry, narrowScope, option, pluginAdminSlug, pluginField, readStoredFields, readableContent, recordAdvisoryNotice, resolvedCollectionDraftSplit, resolvedCollectionView, respondAction, respondDoc, respondList, respondMutation, routePathIsLiteral, rowsThatFit, sanitizeAdminPath, setting, standardWebhooks, storedValueHash, text, textarea, trustedClientIp, updateIfUnchanged, upload, validateFieldValues } from "nextly";
|
|
2
2
|
import { chartColour as widgetChartColour, formatChange as formatWidgetChange, formatCount as formatWidgetNumber } from "@nextlyhq/ui/format";
|
|
3
|
+
import { previewUrlFromTemplate, readableTitleText } from "nextly/config";
|
|
4
|
+
import { humanizeFieldName } from "nextly/field-label";
|
|
5
|
+
import { PENDING_CHANGE_KEY } from "nextly/reserved-filter-keys";
|
|
3
6
|
// src/secret.ts
|
|
4
7
|
const REDACTED = "[redacted]";
|
|
5
8
|
/**
|
|
@@ -40,6 +43,6 @@ function secret(value) {
|
|
|
40
43
|
function isSecret(value) {
|
|
41
44
|
return value instanceof Secret;
|
|
42
45
|
}
|
|
43
|
-
export { AuthEvents, DEFAULT_ADMIN_PATH, DocumentEvents, FilterSeams, MAX_ATTENTION_ITEMS_PER_PLUGIN, MAX_EMAIL_PROVIDER_TYPE_LENGTH, MAX_JOB_SLUG_LENGTH, MediaEvents, NextlyError, PLUGIN_CATEGORIES, PasswordTooLongError, Secret, TIMESERIES_INTERVALS, TrustedHtml, UserEvents, WIDGET_CONDITIONS, WIDGET_LIFECYCLES, WIDGET_OPS, WIDGET_SOURCE_FIELD_TYPES, WIDGET_SOURCE_KINDS, addressableFields, callerReadOptions, checkbox, collectDeclarations, collectionDraftSplit, defineAttentionItem, defineEmailProvider, defineJob, definePlugin, defineWidget, formatWidgetChange, formatWidgetNumber, getCachedNextly, group, isLocaleSelector, isPluginCategory, isSecret, isTimeseriesInterval, markHtml, narrowScope, option, pluginAdminSlug, pluginField, readableContent, resolvedCollectionDraftSplit, resolvedCollectionView, respondAction, respondDoc, respondList, respondMutation, routePathIsLiteral, rowsThatFit, sanitizeAdminPath, secret, setting, text, textarea, trustedClientIp, upload, validateFieldValues, widgetChartColour };
|
|
46
|
+
export { AuthEvents, CORE_ADMIN_PLACES, DEFAULT_ADMIN_PATH, DocumentEvents, FilterSeams, MAX_ATTENTION_ITEMS_PER_PLUGIN, MAX_EMAIL_PROVIDER_TYPE_LENGTH, MAX_JOB_SLUG_LENGTH, MediaEvents, NextlyError, PENDING_CHANGE_KEY, PLUGIN_CATEGORIES, PasswordTooLongError, Secret, TIMESERIES_INTERVALS, TrustedHtml, UserEvents, WIDGET_CONDITIONS, WIDGET_LIFECYCLES, WIDGET_OPS, WIDGET_SOURCE_FIELD_TYPES, WIDGET_SOURCE_KINDS, addressableFields, callerReadOptions, checkbox, collectDeclarations, collectionDraftSplit, defineAttentionItem, defineEmailProvider, defineJob, definePlugin, defineWidget, formatWidgetChange, formatWidgetNumber, getCachedNextly, group, humanizeFieldName, isLocaleSelector, isPluginCategory, isSecret, isTimeseriesInterval, markHtml, mayDeleteEntry, mayWriteEntry, narrowScope, option, pluginAdminSlug, pluginField, previewUrlFromTemplate, readStoredFields, readableContent, readableTitleText, recordAdvisoryNotice, resolvedCollectionDraftSplit, resolvedCollectionView, respondAction, respondDoc, respondList, respondMutation, routePathIsLiteral, rowsThatFit, sanitizeAdminPath, secret, setting, standardWebhooks, storedValueHash, text, textarea, trustedClientIp, updateIfUnchanged, upload, validateFieldValues, widgetChartColour };
|
|
44
47
|
|
|
45
48
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/secret.ts"],"sourcesContent":["const REDACTED = \"[redacted]\";\n\n/**\n * @experimental A secret value that auto-redacts at every common leak vector —\n * `JSON.stringify` (`toJSON`), `String()`/template interpolation (`toString`),\n * and `console.log`/`util.inspect` (the node inspect symbol). The real value is\n * available only via the explicit, greppable `.reveal()`. Wrap secret config /\n * env values (D37): `secret(process.env.API_KEY)`.\n */\nexport class Secret<T = string> {\n readonly #value: T;\n constructor(value: T) {\n this.#value = value;\n }\n /** Return the underlying secret value. The only way to read it. */\n reveal(): T {\n return this.#value;\n }\n toJSON(): string {\n return REDACTED;\n }\n toString(): string {\n return REDACTED;\n }\n}\n\n// `util.inspect` and `console.log` read a custom rendering from Node's own\n// registered symbol, which `Symbol.for` returns without importing `node:util`.\n// Defined on the prototype as a class method would be (not enumerable), rather\n// than in the class: a member under a computed key cannot be declared from the\n// source alone, and the published declaration never named it.\nObject.defineProperty(\n Secret.prototype,\n Symbol.for(\"nodejs.util.inspect.custom\"),\n {\n value(): string {\n return REDACTED;\n },\n writable: true,\n configurable: true,\n }\n);\n\n/** @experimental Wrap a value so it redacts unless explicitly `.reveal()`ed (D37). */\nexport function secret<T>(value: T): Secret<T> {\n return new Secret(value);\n}\n\n/** @experimental True if `value` is a {@link Secret}. */\nexport function isSecret(value: unknown): value is Secret<unknown> {\n return value instanceof Secret;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/secret.ts"],"sourcesContent":["const REDACTED = \"[redacted]\";\n\n/**\n * @experimental A secret value that auto-redacts at every common leak vector —\n * `JSON.stringify` (`toJSON`), `String()`/template interpolation (`toString`),\n * and `console.log`/`util.inspect` (the node inspect symbol). The real value is\n * available only via the explicit, greppable `.reveal()`. Wrap secret config /\n * env values (D37): `secret(process.env.API_KEY)`.\n */\nexport class Secret<T = string> {\n readonly #value: T;\n constructor(value: T) {\n this.#value = value;\n }\n /** Return the underlying secret value. The only way to read it. */\n reveal(): T {\n return this.#value;\n }\n toJSON(): string {\n return REDACTED;\n }\n toString(): string {\n return REDACTED;\n }\n}\n\n// `util.inspect` and `console.log` read a custom rendering from Node's own\n// registered symbol, which `Symbol.for` returns without importing `node:util`.\n// Defined on the prototype as a class method would be (not enumerable), rather\n// than in the class: a member under a computed key cannot be declared from the\n// source alone, and the published declaration never named it.\nObject.defineProperty(\n Secret.prototype,\n Symbol.for(\"nodejs.util.inspect.custom\"),\n {\n value(): string {\n return REDACTED;\n },\n writable: true,\n configurable: true,\n }\n);\n\n/** @experimental Wrap a value so it redacts unless explicitly `.reveal()`ed (D37). */\nexport function secret<T>(value: T): Secret<T> {\n return new Secret(value);\n}\n\n/** @experimental True if `value` is a {@link Secret}. */\nexport function isSecret(value: unknown): value is Secret<unknown> {\n return value instanceof Secret;\n}\n"],"mappings":";;;;;;AAAA,MAAM,WAAW;;;;;;;;AASjB,IAAa,SAAb,MAAgC;CAC9B;CACA,YAAY,OAAU;EACpB,KAAK,SAAS;CAChB;;CAEA,SAAY;EACV,OAAO,KAAK;CACd;CACA,SAAiB;EACf,OAAO;CACT;CACA,WAAmB;EACjB,OAAO;CACT;AACF;AAOA,OAAO,eACL,OAAO,WACP,OAAO,IAAI,4BAA4B,GACvC;CACE,QAAgB;EACd,OAAO;CACT;CACA,UAAU;CACV,cAAc;AAChB,CACF;;AAGA,SAAgB,OAAU,OAAqB;CAC7C,OAAO,IAAI,OAAO,KAAK;AACzB;;AAGA,SAAgB,SAAS,OAA0C;CACjE,OAAO,iBAAiB;AAC1B"}
|
package/dist/routing.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { slugToStaticParam } from "nextly/route-path";
|
|
2
|
-
export { slugToStaticParam };
|
|
1
|
+
import { LIST_PAGE_SEGMENT, listPageNumber, slugToStaticParam } from "nextly/route-path";
|
|
2
|
+
export { LIST_PAGE_SEGMENT, listPageNumber, slugToStaticParam };
|
package/dist/routing.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { slugToStaticParam } from "nextly/route-path";
|
|
1
|
+
export { LIST_PAGE_SEGMENT, listPageNumber, slugToStaticParam } from "nextly/route-path";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextlyhq/plugin-sdk",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.74",
|
|
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": {
|
|
@@ -75,12 +75,12 @@
|
|
|
75
75
|
"node": "^22.12.0 || >=24.0.0"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@nextlyhq/blocks-engine": "0.0.2-alpha.
|
|
79
|
-
"@nextlyhq/ui": "0.0.2-alpha.
|
|
78
|
+
"@nextlyhq/blocks-engine": "0.0.2-alpha.74",
|
|
79
|
+
"@nextlyhq/ui": "0.0.2-alpha.74"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
|
-
"@nextlyhq/admin": "0.0.2-alpha.
|
|
83
|
-
"nextly": "0.0.2-alpha.
|
|
82
|
+
"@nextlyhq/admin": "0.0.2-alpha.74",
|
|
83
|
+
"nextly": "0.0.2-alpha.74",
|
|
84
84
|
"react": "^19.3.0",
|
|
85
85
|
"react-dom": "^19.3.0"
|
|
86
86
|
},
|
|
@@ -96,12 +96,12 @@
|
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
|
-
"@nextlyhq/admin": "0.0.2-alpha.
|
|
100
|
-
"@nextlyhq/tsconfig": "0.0.2-alpha.
|
|
99
|
+
"@nextlyhq/admin": "0.0.2-alpha.74",
|
|
100
|
+
"@nextlyhq/tsconfig": "0.0.2-alpha.74",
|
|
101
101
|
"@types/node": "^22.20.5",
|
|
102
102
|
"@types/react": "19.3.0",
|
|
103
103
|
"jsdom": "^27.1.0",
|
|
104
|
-
"nextly": "0.0.2-alpha.
|
|
104
|
+
"nextly": "0.0.2-alpha.74",
|
|
105
105
|
"react": "19.3.1",
|
|
106
106
|
"react-dom": "19.3.1",
|
|
107
107
|
"tsdown": "^0.23.1",
|