@sevenfold/setto-client 0.36.0 → 0.37.0
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/SettoAnimation.d.ts +1 -1
- package/dist/block-tree/SettoBlockTree.d.ts +2 -2
- package/dist/block-tree/extract-keys.d.ts +1 -1
- package/dist/block-tree/registry.d.ts +1 -1
- package/dist/block-tree/schema.d.ts +3 -3
- package/dist/block-tree/validate.d.ts +1 -1
- package/dist/blog/SettoBlog.d.ts +47 -1
- package/dist/blog/data.d.ts +1 -1
- package/dist/blog/index.d.ts +4 -4
- package/dist/blog/validate.d.ts +1 -1
- package/dist/edit-mode/mount.d.ts +1 -1
- package/dist/index.d.ts +63 -62
- package/dist/lib/api.d.ts +2 -2
- package/dist/lib/map-location.d.ts +2 -2
- package/dist/lib/page-store.d.ts +1 -1
- package/dist/lib/use-site-access.d.ts +1 -1
- package/dist/modules/chat/index.d.ts +2 -2
- package/dist/modules/domain/index.d.ts +1 -1
- package/dist/modules/forms/SettoForm.d.ts +1 -1
- package/dist/modules/forms/api.d.ts +1 -1
- package/dist/modules/forms/field-tools.d.ts +1 -1
- package/dist/modules/forms/index.d.ts +6 -6
- package/dist/modules/index.d.ts +2 -2
- package/dist/pages/SettoPage.d.ts +8 -2
- package/dist/pages/bundled.d.ts +1 -1
- package/dist/pages/manifest.d.ts +12 -0
- package/dist/provider.d.ts +6 -6
- package/dist/setto-client.js +120 -38
- package/dist/setto-client.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/vite/index.d.ts +2 -2
- package/dist/vite/plugin.d.ts +1 -1
- package/dist/vite/static.d.ts +1 -1
- package/dist/vite.js.map +1 -1
- package/package.json +2 -2
package/dist/SettoAnimation.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type { AnimationPreset } from './block-tree/schema';
|
|
2
|
+
import type { AnimationPreset } from './block-tree/schema.js';
|
|
3
3
|
export interface SettoAnimationProps {
|
|
4
4
|
preset: AnimationPreset;
|
|
5
5
|
/** Delay before play, in milliseconds. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComponentType } from 'react';
|
|
2
|
-
import { type SettoIconRenderProps } from '../SettoIcon';
|
|
3
|
-
import type { BlockTree } from './schema';
|
|
2
|
+
import { type SettoIconRenderProps } from '../SettoIcon.js';
|
|
3
|
+
import type { BlockTree } from './schema.js';
|
|
4
4
|
export interface SettoBlockTreeProps {
|
|
5
5
|
/** Validated block tree, typically parsed from `home.layout.json`. */
|
|
6
6
|
tree: BlockTree;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* sample-locale entries it expects. The agent uses this output to validate
|
|
4
4
|
* that the generated `no.json` covers everything the tree references.
|
|
5
5
|
*/
|
|
6
|
-
import type { BlockTree } from './schema';
|
|
6
|
+
import type { BlockTree } from './schema.js';
|
|
7
7
|
export interface ContentKeyRequirements {
|
|
8
8
|
/** Plain i18n keys that must exist with a string value. */
|
|
9
9
|
keys: Set<string>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* consult this registry for allowed children, required content keys, and
|
|
6
6
|
* whether a type carries a theme id.
|
|
7
7
|
*/
|
|
8
|
-
import type { BlockNode, BlockNodeType } from './schema';
|
|
8
|
+
import type { BlockNode, BlockNodeType } from './schema.js';
|
|
9
9
|
export interface BlockTypeMeta {
|
|
10
10
|
/**
|
|
11
11
|
* Allowed child types. `null` means the node is a leaf; `'any'` means any
|
|
@@ -74,8 +74,8 @@ export interface RepeaterNode extends BaseNode {
|
|
|
74
74
|
*/
|
|
75
75
|
itemTemplate: BlockNode[];
|
|
76
76
|
}
|
|
77
|
-
export type { FormFieldType } from '../modules/forms/fields';
|
|
78
|
-
export type { FormFieldProp as FormField } from '../modules/forms/fields';
|
|
77
|
+
export type { FormFieldType } from '../modules/forms/fields.js';
|
|
78
|
+
export type { FormFieldProp as FormField } from '../modules/forms/fields.js';
|
|
79
79
|
export interface FormNode extends BaseNode {
|
|
80
80
|
type: 'form';
|
|
81
81
|
/**
|
|
@@ -95,7 +95,7 @@ export interface FormNode extends BaseNode {
|
|
|
95
95
|
* Seed fields, used only while the locale has no `form.{formId}.fields`
|
|
96
96
|
* list. Once the editor touches the field set, the locale wins.
|
|
97
97
|
*/
|
|
98
|
-
fields?: import('../modules/forms/fields').FormFieldProp[];
|
|
98
|
+
fields?: import('../modules/forms/fields.js').FormFieldProp[];
|
|
99
99
|
}
|
|
100
100
|
export interface VideoNode extends BaseNode {
|
|
101
101
|
type: 'video';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* and `setto-agent` (after generation, before sandbox build). No external
|
|
6
6
|
* dependencies so we can ship to host sites without bundle bloat.
|
|
7
7
|
*/
|
|
8
|
-
import type { BlockTree, FormField } from './schema';
|
|
8
|
+
import type { BlockTree, FormField } from './schema.js';
|
|
9
9
|
export interface ValidationIssue {
|
|
10
10
|
/** Dotted path to the offending node, e.g. `root[2].children[0]`. */
|
|
11
11
|
path: string;
|
package/dist/blog/SettoBlog.d.ts
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The blog's two built-in sections (R24).
|
|
3
|
+
*
|
|
4
|
+
* `blog` lives on the blog page and draws either the list of posts or, at
|
|
5
|
+
* `<page path>/<slug>`, one post. `blog-latest` is a band of the newest posts
|
|
6
|
+
* for the front page. Both read the posts the site's build bundles
|
|
7
|
+
* (`SettoConfig.blog`, from `virtual:setto-blog`). The band draws nothing
|
|
8
|
+
* without them; the blog page says there are none yet.
|
|
9
|
+
*
|
|
10
|
+
* The owner, signed in on their own site, also gets the `blog-owner` chrome
|
|
11
|
+
* slot at the top of the blog page: Pixel's welcome on an empty blog, the
|
|
12
|
+
* article Pixel is writing, and a draft waiting for approval — drawn here, in
|
|
13
|
+
* the site's own blog design, by `BlogDraft`, so what the owner approves is
|
|
14
|
+
* what readers will see.
|
|
15
|
+
*
|
|
16
|
+
* The look is the site's: type and colour are inherited, and the stylesheet
|
|
17
|
+
* below only gives shape — scoped under `.setto-blog` so Tailwind's reset
|
|
18
|
+
* cannot strip it, and at zero specificity for colour so the site always
|
|
19
|
+
* wins. However a redesign restyles these classes, the posts keep rendering:
|
|
20
|
+
* the file contract is what may not change.
|
|
21
|
+
*/
|
|
22
|
+
import { type ComponentType } from 'react';
|
|
23
|
+
import type { RootContent } from 'mdast';
|
|
24
|
+
import { type BuiltinSectionProps } from '../pages/SettoPage.js';
|
|
25
|
+
import { type BlogFrontmatter } from './contract.js';
|
|
2
26
|
export declare function SettoBlogSection({ sectionId, first }: BuiltinSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
3
27
|
/**
|
|
4
28
|
* The blog for a site that routes by hand instead of through `pages.json`
|
|
@@ -11,6 +35,28 @@ export declare function SettoBlog({ basePath, title }: {
|
|
|
11
35
|
basePath?: string;
|
|
12
36
|
title?: string;
|
|
13
37
|
}): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
/** A post not yet published, as setto-server sends it: the frontmatter and the body's tree, each node with `at`. */
|
|
39
|
+
export interface BlogDraftData {
|
|
40
|
+
frontmatter: BlogFrontmatter;
|
|
41
|
+
body: {
|
|
42
|
+
children: RootContent[];
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** What the chrome's `blog-owner` slot is given. */
|
|
46
|
+
export interface BlogOwnerSlotProps {
|
|
47
|
+
blogPath: string;
|
|
48
|
+
language: string;
|
|
49
|
+
/** Published posts in this language, as of the site's last build. */
|
|
50
|
+
posts: number;
|
|
51
|
+
/** Draws a draft in the site's own blog design; title, lead and cover carry `data-setto-field`. */
|
|
52
|
+
Draft: ComponentType<{
|
|
53
|
+
draft: BlogDraftData;
|
|
54
|
+
}>;
|
|
55
|
+
}
|
|
56
|
+
/** A draft, as it will read once published. Given to the chrome's `blog-owner` slot. */
|
|
57
|
+
export declare function BlogDraft({ draft }: {
|
|
58
|
+
draft: BlogDraftData;
|
|
59
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
60
|
export declare function SettoBlogLatest({ sectionId, first }: BuiltinSectionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
15
61
|
/**
|
|
16
62
|
* Shape is scoped `.setto-blog :where(…)` (one class: beats Preflight's
|
package/dist/blog/data.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* tree, so the browser only walks data.
|
|
6
6
|
*/
|
|
7
7
|
import type { Root } from 'mdast';
|
|
8
|
-
import type { BlogFrontmatter } from './contract';
|
|
8
|
+
import type { BlogFrontmatter } from './contract.js';
|
|
9
9
|
/** A post as the list knows it: its frontmatter, and nothing to download. */
|
|
10
10
|
export type BlogPostSummary = BlogFrontmatter;
|
|
11
11
|
/** A post as its page knows it: frontmatter and the body's syntax tree. */
|
package/dist/blog/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* bundle: setto-server and setto-agent validate with it, and the site's build
|
|
6
6
|
* step uses it to read posts.
|
|
7
7
|
*/
|
|
8
|
-
export * from './contract';
|
|
8
|
+
export * from './contract.js';
|
|
9
9
|
/** The host a post's images must come from: pass it as `imageHosts`. */
|
|
10
|
-
export { SETTO_MEDIA_HOST, isSettoMediaUrl } from '../lib/media';
|
|
11
|
-
export { validateBlogPost, parseBlogPost } from './validate';
|
|
12
|
-
export type { BlogIssue, BlogPost, BlogValidationResult, BlogValidateOptions } from './validate';
|
|
10
|
+
export { SETTO_MEDIA_HOST, isSettoMediaUrl } from '../lib/media.js';
|
|
11
|
+
export { validateBlogPost, parseBlogPost } from './validate.js';
|
|
12
|
+
export type { BlogIssue, BlogPost, BlogValidationResult, BlogValidateOptions } from './validate.js';
|
package/dist/blog/validate.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* first reader of a failure is usually a model that has to fix its own output.
|
|
8
8
|
*/
|
|
9
9
|
import type { Root } from 'mdast';
|
|
10
|
-
import { type BlogFrontmatter } from './contract';
|
|
10
|
+
import { type BlogFrontmatter } from './contract.js';
|
|
11
11
|
export interface BlogIssue {
|
|
12
12
|
/** `frontmatter`, `frontmatter.<key>`, `body` or `path`. */
|
|
13
13
|
path: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
export { SettoLanguages } from './LanguageSwitcher';
|
|
2
|
-
export { DEFAULT_LANGUAGE, languageName, pickInitialLanguage, siteLanguages, } from './lib/languages';
|
|
3
|
-
export { alternateLinks, languageFromPath, pathForLanguage, redirectForVisitor, type LanguageRoute, } from './lib/language-routing';
|
|
4
|
-
export { SettoProvider, useSetto } from './provider';
|
|
5
|
-
export { GuestEditProvider, useGuestEdit } from './guest-edit';
|
|
6
|
-
export { SettoChrome, useSettoChromeSlot } from './chrome';
|
|
7
|
-
export type { SettoChromeHandshake } from './chrome';
|
|
8
|
-
export { T } from './T';
|
|
9
|
-
export { SettoSection } from './SettoSection';
|
|
10
|
-
export { SettoBlock } from './SettoBlock';
|
|
11
|
-
export { SettoIcon } from './SettoIcon';
|
|
12
|
-
export type { SettoIconProps, SettoIconRenderProps } from './SettoIcon';
|
|
13
|
-
export { SettoImage } from './SettoImage';
|
|
14
|
-
export type { SettoImageProps, ImageToolsProps } from './SettoImage';
|
|
15
|
-
export { SETTO_IMAGE_QUALITY, SETTO_IMAGE_WIDTHS, isOptimizable, optimizedSrcSet, optimizedUrl, settoVercelImagesConfig, } from './lib/optimized-image';
|
|
16
|
-
export { SETTO_MEDIA_HOST, isSettoMediaUrl } from './lib/media';
|
|
17
|
-
export { SettoBlog, SettoBlogSection, SettoBlogLatest, BLOG_CSS } from './blog/SettoBlog';
|
|
18
|
-
export {
|
|
19
|
-
export
|
|
20
|
-
export {
|
|
21
|
-
export
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export
|
|
25
|
-
export {
|
|
26
|
-
export
|
|
27
|
-
export {
|
|
28
|
-
export
|
|
29
|
-
export {
|
|
30
|
-
export
|
|
31
|
-
export type {
|
|
32
|
-
export {
|
|
33
|
-
export
|
|
34
|
-
export {
|
|
35
|
-
export
|
|
36
|
-
export {
|
|
37
|
-
export
|
|
38
|
-
export {
|
|
39
|
-
export
|
|
40
|
-
export {
|
|
41
|
-
export {
|
|
42
|
-
export {
|
|
43
|
-
export
|
|
44
|
-
export {
|
|
45
|
-
export
|
|
46
|
-
export type {
|
|
47
|
-
export {
|
|
48
|
-
export
|
|
49
|
-
export type {
|
|
50
|
-
export {
|
|
51
|
-
export {
|
|
52
|
-
export {
|
|
53
|
-
export
|
|
54
|
-
export {
|
|
55
|
-
export {
|
|
56
|
-
export {
|
|
57
|
-
export
|
|
58
|
-
export {
|
|
59
|
-
export {
|
|
60
|
-
export {
|
|
61
|
-
export {
|
|
62
|
-
export
|
|
1
|
+
export { SettoLanguages } from './LanguageSwitcher.js';
|
|
2
|
+
export { DEFAULT_LANGUAGE, languageName, pickInitialLanguage, siteLanguages, } from './lib/languages.js';
|
|
3
|
+
export { alternateLinks, languageFromPath, pathForLanguage, redirectForVisitor, type LanguageRoute, } from './lib/language-routing.js';
|
|
4
|
+
export { SettoProvider, useSetto } from './provider.js';
|
|
5
|
+
export { GuestEditProvider, useGuestEdit } from './guest-edit.js';
|
|
6
|
+
export { SettoChrome, useSettoChromeSlot } from './chrome.js';
|
|
7
|
+
export type { SettoChromeHandshake } from './chrome.js';
|
|
8
|
+
export { T } from './T.js';
|
|
9
|
+
export { SettoSection } from './SettoSection.js';
|
|
10
|
+
export { SettoBlock } from './SettoBlock.js';
|
|
11
|
+
export { SettoIcon } from './SettoIcon.js';
|
|
12
|
+
export type { SettoIconProps, SettoIconRenderProps } from './SettoIcon.js';
|
|
13
|
+
export { SettoImage } from './SettoImage.js';
|
|
14
|
+
export type { SettoImageProps, ImageToolsProps } from './SettoImage.js';
|
|
15
|
+
export { SETTO_IMAGE_QUALITY, SETTO_IMAGE_WIDTHS, isOptimizable, optimizedSrcSet, optimizedUrl, settoVercelImagesConfig, } from './lib/optimized-image.js';
|
|
16
|
+
export { SETTO_MEDIA_HOST, isSettoMediaUrl } from './lib/media.js';
|
|
17
|
+
export { SettoBlog, SettoBlogSection, SettoBlogLatest, BlogDraft, BLOG_CSS } from './blog/SettoBlog.js';
|
|
18
|
+
export type { BlogDraftData, BlogOwnerSlotProps } from './blog/SettoBlog.js';
|
|
19
|
+
export { postsForLanguage, postForSlug, formatPostDate } from './blog/data.js';
|
|
20
|
+
export type { SettoBlogData, BlogPostData, BlogPostSummary } from './blog/data.js';
|
|
21
|
+
export { SettoRepeater } from './SettoRepeater.js';
|
|
22
|
+
export type { SettoRepeaterProps } from './SettoRepeater.js';
|
|
23
|
+
export { SettoForm, FORM_FIELD_TYPES, FORM_FIELD_TYPE_LABELS, fieldTypeHasOptions, fieldTypeHasPlaceholder, formFieldsPrefix, isFormFieldType, readLocaleFields, settoSubmissionUrl, } from './modules/forms/index.js';
|
|
24
|
+
export { SettoChat } from './modules/chat/index.js';
|
|
25
|
+
export type { SettoFormProps, SettoFormClassNames, FormFieldProp, FormSettings, FormSubmissionRow, FormValue, FormValues, ResolvedFormField, SubmissionEnvelope, } from './modules/forms/index.js';
|
|
26
|
+
export { SETTO_MODULES } from './modules/index.js';
|
|
27
|
+
export type { SettoModule } from './modules/index.js';
|
|
28
|
+
export { SettoVideo } from './SettoVideo.js';
|
|
29
|
+
export type { SettoVideoProps } from './SettoVideo.js';
|
|
30
|
+
export { SettoMap } from './SettoMap.js';
|
|
31
|
+
export type { SettoMapProps } from './SettoMap.js';
|
|
32
|
+
export type { MapLocation, MapToolsProps, MapToolsComponent } from './map-tools.js';
|
|
33
|
+
export { SettoPage, SettoTextSection, usePageManifest, useSettoMenu, } from './pages/SettoPage.js';
|
|
34
|
+
export type { SettoPageProps, BuiltinSectionProps } from './pages/SettoPage.js';
|
|
35
|
+
export { PAGES_PATH, PAGES_MANIFEST_VERSION, BUILTIN_SECTION_TYPES, parseManifest, normalisePath, pageForPath, blogPage, blogSlugForPath, pageById, findSection, visibleMenu, ownerMenu, applyOp, applyOps, builtinKeys, pageTitleKey, serialiseManifest, isSafeHref, ManifestError, } from './pages/manifest.js';
|
|
36
|
+
export type { PagesManifest, PageEntry, PageSection, MenuItem, MenuList, ManifestOp, ManifestIssue, ManifestParse, BuiltinSectionType, } from './pages/manifest.js';
|
|
37
|
+
export { PageStore, EMPTY_PAGE_STORE_SNAPSHOT, countChanges } from './lib/page-store.js';
|
|
38
|
+
export type { PageStoreSnapshot } from './lib/page-store.js';
|
|
39
|
+
export { SettoAnimation } from './SettoAnimation.js';
|
|
40
|
+
export type { SettoAnimationProps } from './SettoAnimation.js';
|
|
41
|
+
export { useSectionTheme } from './use-section-theme.js';
|
|
42
|
+
export { SettoAdminApp } from './admin/App.js';
|
|
43
|
+
export { SettoContext } from './provider.js';
|
|
44
|
+
export type { SettoContextValue } from './provider.js';
|
|
45
|
+
export { AuthGate } from './edit-mode/auth-gate.js';
|
|
46
|
+
export type { SettoConfig, BrandColor, DeploymentRow, SiteRow, ContentFile, PublishFile, PublishResult, PublishTranslation, } from './types.js';
|
|
47
|
+
export type { SectionSchema, SectionColorField } from './section-schema.js';
|
|
48
|
+
export { SettoBlockTree } from './block-tree/SettoBlockTree.js';
|
|
49
|
+
export type { SettoBlockTreeProps } from './block-tree/SettoBlockTree.js';
|
|
50
|
+
export type { BlockTree, BlockTreeVersion, BlockNode, BlockNodeType, SectionNode, BlockBoxNode, ContainerNode, ContainerTag, TextNode, TextAs, ImageNode, IconNode, RepeaterNode, FormNode, FormField, FormFieldType, VideoNode, AnimationNode, AnimationPreset, } from './block-tree/schema.js';
|
|
51
|
+
export { validateBlockTree, parseBlockTree, type ValidationIssue, type ValidationResult, } from './block-tree/validate.js';
|
|
52
|
+
export { extractContentKeys, type ContentKeyRequirements, } from './block-tree/extract-keys.js';
|
|
53
|
+
export { BLOCK_REGISTRY, BLOCK_TYPES, nodeChildren } from './block-tree/registry.js';
|
|
54
|
+
export type { BlockTypeMeta } from './block-tree/registry.js';
|
|
55
|
+
export { SETTO_BASE, siteHomeUrl, isAdminRoute, isAdminDeploymentView, adminViewUrl, currentAdminView, isAdminPanelView, adminRedirectUrl, CHECKOUT_INTENT, checkoutIntentUrl, wantsCheckout, withoutCheckoutIntent, } from './lib/urls.js';
|
|
56
|
+
export { SettoMark } from './edit-mode/setto-mark.js';
|
|
57
|
+
export { FloatingPopover } from './edit-mode/floating-popover.js';
|
|
58
|
+
export type { FieldPatch, FormFieldToolsProps, FormFieldToolsComponent, } from './modules/forms/field-tools.js';
|
|
59
|
+
export { isLinkContext } from './lib/link-context.js';
|
|
60
|
+
export { useCoarsePointer } from './lib/use-coarse-pointer.js';
|
|
61
|
+
export { FAB_SIZE, FAB_INSET } from './edit-mode/constants.js';
|
|
62
|
+
export { EMPTY_I18N_STORE_SNAPSHOT } from './lib/i18n-store.js';
|
|
63
|
+
export type { I18nStoreSnapshot } from './lib/i18n-store.js';
|
package/dist/lib/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SupabaseClient } from '@supabase/supabase-js';
|
|
2
|
-
import type { ContentFile, PublishFile, PublishResult } from '../types';
|
|
3
|
-
import type { AssetDraft } from './asset-store';
|
|
2
|
+
import type { ContentFile, PublishFile, PublishResult } from '../types.js';
|
|
3
|
+
import type { AssetDraft } from './asset-store.js';
|
|
4
4
|
/**
|
|
5
5
|
* One authenticated JSON call against setto-server. Modules build their api
|
|
6
6
|
* segment on this (see `modules/forms/api.ts`) rather than on `fetch`, so
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MapLocation } from '../map-tools';
|
|
2
|
-
import type { I18nStore } from './i18n-store';
|
|
1
|
+
import type { MapLocation } from '../map-tools.js';
|
|
2
|
+
import type { I18nStore } from './i18n-store.js';
|
|
3
3
|
/**
|
|
4
4
|
* Where a `SettoMap` points, and how that becomes an OpenStreetMap embed.
|
|
5
5
|
*
|
package/dist/lib/page-store.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ManifestOp, type PagesManifest } from '../pages/manifest';
|
|
1
|
+
import { type ManifestOp, type PagesManifest } from '../pages/manifest.js';
|
|
2
2
|
export interface PageStoreSnapshot {
|
|
3
3
|
manifest: PagesManifest | null;
|
|
4
4
|
/** How many pages, sections and links differ from what is published. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Session, SupabaseClient } from '@supabase/supabase-js';
|
|
2
|
-
import type { SiteRow } from '../types';
|
|
2
|
+
import type { SiteRow } from '../types.js';
|
|
3
3
|
export interface SiteAccessState {
|
|
4
4
|
/** All sites the current user can access. `null` until loaded. */
|
|
5
5
|
sites: SiteRow[] | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { SettoModule } from '../module';
|
|
1
|
+
import type { SettoModule } from '../module.js';
|
|
2
2
|
export declare const chatModule: SettoModule;
|
|
3
|
-
export { SettoChat } from './SettoChat';
|
|
3
|
+
export { SettoChat } from './SettoChat.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApiRequest } from '../../lib/api';
|
|
1
|
+
import type { ApiRequest } from '../../lib/api.js';
|
|
2
2
|
/** The forms row of `site_module_settings` as the server reports it, with the defaults resolved. */
|
|
3
3
|
export interface FormSettings {
|
|
4
4
|
/** Addresses the owner chose; empty means "use the defaults". */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
|
-
import type { FormFieldType, ResolvedFormField } from './fields';
|
|
2
|
+
import type { FormFieldType, ResolvedFormField } from './fields.js';
|
|
3
3
|
/**
|
|
4
4
|
* The contract between a form on the customer's page and the editing tools
|
|
5
5
|
* Setto serves for it.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { SettoModule } from '../module';
|
|
1
|
+
import type { SettoModule } from '../module.js';
|
|
2
2
|
/**
|
|
3
3
|
* The forms module: a form primitive the site renders, and the api segment
|
|
4
4
|
* behind it. Server side lives in setto-server `src/modules/forms`, and so
|
|
5
5
|
* does the inbox the customer reads submissions in.
|
|
6
6
|
*/
|
|
7
7
|
export declare const formsModule: SettoModule;
|
|
8
|
-
export { SettoForm } from './SettoForm';
|
|
9
|
-
export type { SettoFormProps, SettoFormClassNames } from './SettoForm';
|
|
10
|
-
export type { FormSettings, FormSubmissionRow, FormsApi } from './api';
|
|
11
|
-
export { FORM_FIELD_TYPES, FORM_FIELD_TYPE_LABELS, fieldTypeHasOptions, fieldTypeHasPlaceholder, formFieldsPrefix, isFormFieldType, readLocaleFields, settoSubmissionUrl, } from './fields';
|
|
12
|
-
export type { FormFieldProp, FormFieldType, FormValue, FormValues, ResolvedFormField, SubmissionEnvelope, } from './fields';
|
|
8
|
+
export { SettoForm } from './SettoForm.js';
|
|
9
|
+
export type { SettoFormProps, SettoFormClassNames } from './SettoForm.js';
|
|
10
|
+
export type { FormSettings, FormSubmissionRow, FormsApi } from './api.js';
|
|
11
|
+
export { FORM_FIELD_TYPES, FORM_FIELD_TYPE_LABELS, fieldTypeHasOptions, fieldTypeHasPlaceholder, formFieldsPrefix, isFormFieldType, readLocaleFields, settoSubmissionUrl, } from './fields.js';
|
|
12
|
+
export type { FormFieldProp, FormFieldType, FormValue, FormValues, ResolvedFormField, SubmissionEnvelope, } from './fields.js';
|
package/dist/modules/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SettoModule } from './module';
|
|
2
|
-
export type { SettoModule } from './module';
|
|
1
|
+
import type { SettoModule } from './module.js';
|
|
2
|
+
export type { SettoModule } from './module.js';
|
|
3
3
|
/** Every module the dashboard shows, in tab order. Setto draws the tabs. */
|
|
4
4
|
export declare const SETTO_MODULES: readonly SettoModule[];
|
|
5
5
|
export declare function findModule(id: string | null): SettoModule | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentType, type ReactNode } from 'react';
|
|
2
|
-
import { type BuiltinSectionType, type MenuItem, type MenuList, type PagesManifest } from './manifest';
|
|
2
|
+
import { type BuiltinSectionType, type MenuItem, type MenuList, type PagesManifest } from './manifest.js';
|
|
3
3
|
/**
|
|
4
4
|
* The manifest as it stands now, drafts included, re-rendering on change.
|
|
5
5
|
* `null` on a site that has none.
|
|
@@ -11,8 +11,14 @@ export declare function usePageManifest(): PagesManifest | null;
|
|
|
11
11
|
*
|
|
12
12
|
* Already filtered: hidden links, links to hidden pages and anchors to hidden
|
|
13
13
|
* sections are gone. Render each label with `<T k={item.labelKey} />`.
|
|
14
|
+
*
|
|
15
|
+
* The signed-in owner also gets the blog's link while the blog has no posts
|
|
16
|
+
* (`ownerMenu`), marked `dimmed` and drawn faded by a stylesheet this hook
|
|
17
|
+
* adds, so no site's navbar has to know about it.
|
|
14
18
|
*/
|
|
15
|
-
export declare function useSettoMenu(list?: MenuList): MenuItem
|
|
19
|
+
export declare function useSettoMenu(list?: MenuList): Array<MenuItem & {
|
|
20
|
+
dimmed?: true;
|
|
21
|
+
}> | null;
|
|
16
22
|
/** What a built-in section's renderer is given. */
|
|
17
23
|
export interface BuiltinSectionProps {
|
|
18
24
|
sectionId: string;
|
package/dist/pages/bundled.d.ts
CHANGED
package/dist/pages/manifest.d.ts
CHANGED
|
@@ -117,6 +117,18 @@ export declare function findSection(manifest: PagesManifest, sectionId: string):
|
|
|
117
117
|
* winter should not leave a menu entry that scrolls to nothing.
|
|
118
118
|
*/
|
|
119
119
|
export declare function visibleMenu(manifest: PagesManifest, list: MenuList): MenuItem[];
|
|
120
|
+
/**
|
|
121
|
+
* The links the site's owner sees, signed in on their own site.
|
|
122
|
+
*
|
|
123
|
+
* What a visitor sees, and one more: the blog's link while the blog is on but
|
|
124
|
+
* has no posts yet. Visitors are spared a menu entry that leads to an empty
|
|
125
|
+
* page; the owner gets it `dimmed`, as the way in — the empty blog is where
|
|
126
|
+
* Pixel offers to write the first article. A blog link the owner hid
|
|
127
|
+
* themselves once posts exist stays hidden.
|
|
128
|
+
*/
|
|
129
|
+
export declare function ownerMenu(manifest: PagesManifest, list: MenuList, blogEmpty: boolean): Array<MenuItem & {
|
|
130
|
+
dimmed?: true;
|
|
131
|
+
}>;
|
|
120
132
|
export declare class ManifestError extends Error {
|
|
121
133
|
readonly code: 'page_not_found' | 'section_not_found' | 'item_not_found' | 'duplicate_id' | 'duplicate_path' | 'invalid';
|
|
122
134
|
constructor(code: 'page_not_found' | 'section_not_found' | 'item_not_found' | 'duplicate_id' | 'duplicate_path' | 'invalid', message: string);
|
package/dist/provider.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { SupabaseClient, Session } from '@supabase/supabase-js';
|
|
3
|
-
import { type SettoApi } from './lib/api';
|
|
4
|
-
import { I18nStore } from './lib/i18n-store';
|
|
5
|
-
import { AssetStore } from './lib/asset-store';
|
|
6
|
-
import { ThemeStore } from './lib/theme-store';
|
|
7
|
-
import { PageStore } from './lib/page-store';
|
|
8
|
-
import type { SettoConfig, SiteRow } from './types';
|
|
3
|
+
import { type SettoApi } from './lib/api.js';
|
|
4
|
+
import { I18nStore } from './lib/i18n-store.js';
|
|
5
|
+
import { AssetStore } from './lib/asset-store.js';
|
|
6
|
+
import { ThemeStore } from './lib/theme-store.js';
|
|
7
|
+
import { PageStore } from './lib/page-store.js';
|
|
8
|
+
import type { SettoConfig, SiteRow } from './types.js';
|
|
9
9
|
export interface SettoContextValue {
|
|
10
10
|
config: SettoConfig;
|
|
11
11
|
supabase: SupabaseClient;
|