@geekity/cms 0.4.0 → 0.6.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/README.md +246 -110
- package/admin/pages/documents/editor.njk +0 -13
- package/admin/pages/{settings/federation.njk → federation/settings.njk} +7 -5
- package/admin/pages/navigation/menus.njk +132 -0
- package/admin/pages/settings/reading.njk +2 -10
- package/admin/pages/tools/content-index.njk +89 -0
- package/admin/pages/users/edit.njk +25 -2
- package/admin/pages/users/list.njk +5 -2
- package/admin/static/admin.css +78 -3
- package/dist/access-log.d.ts +44 -0
- package/dist/access-log.d.ts.map +1 -0
- package/dist/access-log.js +71 -0
- package/dist/access-log.js.map +1 -0
- package/dist/admin/accounts.d.ts +10 -0
- package/dist/admin/accounts.d.ts.map +1 -1
- package/dist/admin/accounts.js +15 -3
- package/dist/admin/accounts.js.map +1 -1
- package/dist/admin/documents.d.ts +3 -13
- package/dist/admin/documents.d.ts.map +1 -1
- package/dist/admin/documents.js +2 -34
- package/dist/admin/documents.js.map +1 -1
- package/dist/admin/federation.d.ts +10 -0
- package/dist/admin/federation.d.ts.map +1 -1
- package/dist/admin/federation.js +10 -0
- package/dist/admin/federation.js.map +1 -1
- package/dist/admin/index.d.ts +3 -3
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js +2 -2
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/menu.d.ts.map +1 -1
- package/dist/admin/menu.js +19 -2
- package/dist/admin/menu.js.map +1 -1
- package/dist/admin/navigation.d.ts +155 -0
- package/dist/admin/navigation.d.ts.map +1 -0
- package/dist/admin/navigation.js +292 -0
- package/dist/admin/navigation.js.map +1 -0
- package/dist/admin/routes.d.ts.map +1 -1
- package/dist/admin/routes.js +9 -0
- package/dist/admin/routes.js.map +1 -1
- package/dist/admin/session.d.ts +17 -3
- package/dist/admin/session.d.ts.map +1 -1
- package/dist/admin/session.js +19 -5
- package/dist/admin/session.js.map +1 -1
- package/dist/admin/settings-federation.d.ts +10 -1
- package/dist/admin/settings-federation.d.ts.map +1 -1
- package/dist/admin/settings-federation.js +26 -6
- package/dist/admin/settings-federation.js.map +1 -1
- package/dist/admin/settings-page.d.ts +26 -9
- package/dist/admin/settings-page.d.ts.map +1 -1
- package/dist/admin/settings-page.js +18 -12
- package/dist/admin/settings-page.js.map +1 -1
- package/dist/admin/settings-pages.d.ts +14 -3
- package/dist/admin/settings-pages.d.ts.map +1 -1
- package/dist/admin/settings-pages.js +15 -5
- package/dist/admin/settings-pages.js.map +1 -1
- package/dist/admin/settings-reading.d.ts +5 -4
- package/dist/admin/settings-reading.d.ts.map +1 -1
- package/dist/admin/settings-reading.js +6 -5
- package/dist/admin/settings-reading.js.map +1 -1
- package/dist/admin/settings.d.ts +29 -15
- package/dist/admin/settings.d.ts.map +1 -1
- package/dist/admin/settings.js +28 -78
- package/dist/admin/settings.js.map +1 -1
- package/dist/admin/templates.d.ts +3 -1
- package/dist/admin/templates.d.ts.map +1 -1
- package/dist/admin/templates.js +3 -1
- package/dist/admin/templates.js.map +1 -1
- package/dist/admin/tools.d.ts +111 -0
- package/dist/admin/tools.d.ts.map +1 -0
- package/dist/admin/tools.js +182 -0
- package/dist/admin/tools.js.map +1 -0
- package/dist/admin/users.d.ts +24 -0
- package/dist/admin/users.d.ts.map +1 -1
- package/dist/admin/users.js +102 -30
- package/dist/admin/users.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +6 -1
- package/dist/cli.js.map +1 -1
- package/dist/comments/form.d.ts +48 -0
- package/dist/comments/form.d.ts.map +1 -1
- package/dist/comments/form.js +15 -0
- package/dist/comments/form.js.map +1 -1
- package/dist/comments/index.d.ts +4 -3
- package/dist/comments/index.d.ts.map +1 -1
- package/dist/comments/index.js +2 -1
- package/dist/comments/index.js.map +1 -1
- package/dist/comments/routes.d.ts +3 -1
- package/dist/comments/routes.d.ts.map +1 -1
- package/dist/comments/routes.js +46 -11
- package/dist/comments/routes.js.map +1 -1
- package/dist/comments/submission.d.ts +37 -3
- package/dist/comments/submission.d.ts.map +1 -1
- package/dist/comments/submission.js +59 -20
- package/dist/comments/submission.js.map +1 -1
- package/dist/comments/viewer.d.ts +21 -0
- package/dist/comments/viewer.d.ts.map +1 -0
- package/dist/comments/viewer.js +45 -0
- package/dist/comments/viewer.js.map +1 -0
- package/dist/config.d.ts +35 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -0
- package/dist/config.js.map +1 -1
- package/dist/content/store.d.ts +18 -0
- package/dist/content/store.d.ts.map +1 -1
- package/dist/content/store.js +18 -0
- package/dist/content/store.js.map +1 -1
- package/dist/env.d.ts +12 -1
- package/dist/env.d.ts.map +1 -1
- package/dist/federation/mount.d.ts +4 -0
- package/dist/federation/mount.d.ts.map +1 -1
- package/dist/federation/mount.js +60 -15
- package/dist/federation/mount.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -4
- package/dist/index.js.map +1 -1
- package/dist/web/authors.d.ts +15 -1
- package/dist/web/authors.d.ts.map +1 -1
- package/dist/web/authors.js +9 -1
- package/dist/web/authors.js.map +1 -1
- package/dist/web/index.d.ts +4 -4
- package/dist/web/index.d.ts.map +1 -1
- package/dist/web/index.js +1 -1
- package/dist/web/index.js.map +1 -1
- package/dist/web/navigation.d.ts +235 -35
- package/dist/web/navigation.d.ts.map +1 -1
- package/dist/web/navigation.js +333 -57
- package/dist/web/navigation.js.map +1 -1
- package/dist/web/negotiate.d.ts +22 -0
- package/dist/web/negotiate.d.ts.map +1 -1
- package/dist/web/negotiate.js +25 -10
- package/dist/web/negotiate.js.map +1 -1
- package/dist/web/render.d.ts +16 -10
- package/dist/web/render.d.ts.map +1 -1
- package/dist/web/render.js +21 -14
- package/dist/web/render.js.map +1 -1
- package/dist/web/routes.d.ts.map +1 -1
- package/dist/web/routes.js +11 -2
- package/dist/web/routes.js.map +1 -1
- package/dist/web/themes.d.ts +21 -0
- package/dist/web/themes.d.ts.map +1 -1
- package/dist/web/themes.js +37 -0
- package/dist/web/themes.js.map +1 -1
- package/package.json +1 -1
- package/templates/site/content/_data/site.json +7 -0
- package/templates/site/content/pages/about.md +7 -0
- package/themes/default/README.md +215 -80
- package/themes/default/layouts/author.njk +3 -4
- package/themes/default/layouts/base.njk +38 -49
- package/themes/default/layouts/front-page.njk +1 -2
- package/themes/default/partials/bio.njk +20 -22
- package/themes/default/partials/comment-form.njk +31 -3
- package/themes/default/partials/menu.njk +34 -0
- package/themes/default/partials/search-form.njk +5 -0
- package/themes/default/static/style.css +54 -13
- package/themes/default/theme.json +5 -1
package/dist/web/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { AssetResponseOptions, StaticAsset, ThemeAsset } from './assets.ts'
|
|
|
3
3
|
export { archiveMonths, ARCHIVE_FRONT_MATTER_KEY, archiveOpen } from './archive.ts';
|
|
4
4
|
export type { ArchiveEntry, ArchiveMonth } from './archive.ts';
|
|
5
5
|
export { AUTHOR_BASE, authorContext, authorFeedHref, authorHref, authorNames, INBOX_BASE, parseAuthorPath, profileContext, siteAuthorContext, userForAuthor, } from './authors.ts';
|
|
6
|
-
export type { AuthorContext, AuthorRequest } from './authors.ts';
|
|
6
|
+
export type { AuthorContext, AuthorRequest, PublishedProfileLink } from './authors.ts';
|
|
7
7
|
export { createSiteDataSource, DEFAULT_POSTS_PER_PAGE, documentContext, frontPageSlugs, postsPerPage, siteTimezone, SITE_DATA_FILE, taxonomyBases, termRedirects, themeName, } from './context.ts';
|
|
8
8
|
export type { DocumentContext, FrontPageSlugs, NeighbourContext, PageContext, SiteData, SiteDataSource, } from './context.ts';
|
|
9
9
|
export { commentAnchor, createConversation, feedComments, spokenIn } from './conversation.ts';
|
|
@@ -13,8 +13,8 @@ export { atomEntry, atomFeed, cdata, commentsFeedPath, commentsFeedResponse, com
|
|
|
13
13
|
export type { CommentFeedSource, FeedComment, FeedFormat, FeedIdentity, FeedItem, FeedItemComments, FeedItemContext, FeedPath, FeedResponseOptions, FeedSource, JsonFeed, JsonFeedAuthor, JsonFeedHub, JsonFeedItem, NotifyServer, } from './feeds.ts';
|
|
14
14
|
export { absoluteUrl, ACTIVITY_STREAMS_MEDIA_TYPES, alternateLinks, contentEtag, DOCUMENT_REPRESENTATIONS, documentJson, isNotModified, latestModified, JSON_SCHEMA_VERSION, lastModifiedOf, LISTING_REPRESENTATIONS, MEDIA_TYPES, notAcceptableResponse, parseAccept, prefersActivityStreams, representationEtag, representationHref, REPRESENTATION_EXTENSIONS, representationResponse, selectRepresentation, splitRepresentationExtension, } from './negotiate.ts';
|
|
15
15
|
export type { AcceptRange, ConditionalHeaders, DocumentJson, DocumentJsonOptions, Representation, RepresentationExtension, RepresentationResponseOptions, } from './negotiate.ts';
|
|
16
|
-
export { navigationItems, navigationItemsOf, navigationMenu,
|
|
17
|
-
export type { MenuItem, NavigationItem, NavigationMenuOptions } from './navigation.ts';
|
|
16
|
+
export { DEFAULT_MENU_NAME, isLinkUrl, LINK_REL_RULE, LINK_URL_RULE, MENU_NAME_MAX_LENGTH, MENU_NAME_PATTERN, menuItemLineProblem, menuItemOf, menuItemsFromText, menuItemsText, menuNameProblem, menusOf, navigationItems, navigationItemsOf, navigationMenu, navigationMenus, REL_VALUE_PATTERN, relText, relValuesOf, siteMenus, splitLinkRel, } from './navigation.ts';
|
|
17
|
+
export type { LinkLine, MenuItem, MenuList, NavigationItem, NavigationMenuOptions, NavigationMenus, NavigationMenusOptions, } from './navigation.ts';
|
|
18
18
|
export { HEALTH_PATH, mountHealth } from './health.ts';
|
|
19
19
|
export { offsetForPage, paginate } from './pagination.ts';
|
|
20
20
|
export type { Pagination, PaginateOptions } from './pagination.ts';
|
|
@@ -33,5 +33,5 @@ export type { Taxonomy, TaxonomyBaseProblems, TaxonomyBases, TaxonomyRedirect, T
|
|
|
33
33
|
export { createTemplateEnvironment, formatDate, useThemeDirs } from './templates.ts';
|
|
34
34
|
export type { CreateTemplateEnvironmentOptions, DateFormat } from './templates.ts';
|
|
35
35
|
export { chooseTheme, createThemeSource, findThemeFile, PACKAGED_THEME_DIR, readTheme, SITE_THEME_KIND, THEME_MANIFEST_FILE, themeNameProblem, themeSearchPath, } from './themes.ts';
|
|
36
|
-
export type { ChosenTheme, Theme, ThemeKind, ThemeLogger, ThemeRead, ThemeSource, } from './themes.ts';
|
|
36
|
+
export type { ChosenTheme, Theme, ThemeArea, ThemeKind, ThemeLogger, ThemeRead, ThemeSource, } from './themes.ts';
|
|
37
37
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/web/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,oBAAoB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACpF,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,UAA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E,MAAM,aAAa,CAAC;AACnF,OAAO,EACL,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,OAAO,EACP,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,QAAQ,EACR,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACrF,YAAY,EAAE,gCAAgC,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,WAAW,GACZ,MAAM,aAAa,CAAC"}
|
package/dist/web/index.js
CHANGED
|
@@ -6,7 +6,7 @@ export { commentAnchor, createConversation, feedComments, spokenIn } from './con
|
|
|
6
6
|
export { activityStreamsId, isPublicDocument, postObjectId, publicDocumentAt, } from './documents.js';
|
|
7
7
|
export { atomEntry, atomFeed, cdata, commentsFeedPath, commentsFeedResponse, commentsRssFeed, COMMENTS_ROOT, COMMENTS_TITLE_PREFIX, contentTypeOf, DC_NAMESPACE, DEFAULT_FEED_LANGUAGE, DEFAULT_FEED_SIZE, DEFAULT_NOTIFY_SERVER, escapeXml, excerptFromHtml, EXCERPT_WORDS, FEED_ALIASES, FEED_CONTENT_TYPES, FEED_FORMATS, FEED_GENERATOR, FEED_GENERATOR_URI, FEED_ITEM_REVISION, FEED_SEGMENT, FEED_SEGMENTS, feedExcerpt, feedItem, feedItems, feedLanguage, feedLinkHeader, feedPathUnder, feedResponse, feedSize, jsonFeed, jsonFeedItem, JSON_FEED_HUB_TYPE, JSON_FEED_VERSION, NOTIFY_CLOUD_PORT, NOTIFY_CLOUD_PROTOCOL, NOTIFY_PATHS, notifyEndpoints, notifyServerOf, rfc822, rssFeed, rssItem, SOURCE_NAMESPACE, splitFeedPath, WFW_NAMESPACE, } from './feeds.js';
|
|
8
8
|
export { absoluteUrl, ACTIVITY_STREAMS_MEDIA_TYPES, alternateLinks, contentEtag, DOCUMENT_REPRESENTATIONS, documentJson, isNotModified, latestModified, JSON_SCHEMA_VERSION, lastModifiedOf, LISTING_REPRESENTATIONS, MEDIA_TYPES, notAcceptableResponse, parseAccept, prefersActivityStreams, representationEtag, representationHref, REPRESENTATION_EXTENSIONS, representationResponse, selectRepresentation, splitRepresentationExtension, } from './negotiate.js';
|
|
9
|
-
export { navigationItems, navigationItemsOf, navigationMenu,
|
|
9
|
+
export { DEFAULT_MENU_NAME, isLinkUrl, LINK_REL_RULE, LINK_URL_RULE, MENU_NAME_MAX_LENGTH, MENU_NAME_PATTERN, menuItemLineProblem, menuItemOf, menuItemsFromText, menuItemsText, menuNameProblem, menusOf, navigationItems, navigationItemsOf, navigationMenu, navigationMenus, REL_VALUE_PATTERN, relText, relValuesOf, siteMenus, splitLinkRel, } from './navigation.js';
|
|
10
10
|
export { HEALTH_PATH, mountHealth } from './health.js';
|
|
11
11
|
export { offsetForPage, paginate } from './pagination.js';
|
|
12
12
|
export { recentPosts, RECENT_POSTS, startOfMonth } from './recent.js';
|
package/dist/web/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEpF,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,SAAS,GACV,MAAM,cAAc,CAAC;AAStB,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAa9F,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,SAAS,EACT,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,EACT,eAAe,EACf,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,cAAc,EACd,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,MAAM,EACN,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,aAAa,EACb,aAAa,GACd,MAAM,YAAY,CAAC;AAkBpB,OAAO,EACL,WAAW,EACX,4BAA4B,EAC5B,cAAc,EACd,WAAW,EACX,wBAAwB,EACxB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,qBAAqB,EACrB,WAAW,EACX,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEpF,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,YAA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B,QAAQ,GACT,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAErF,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC"}
|
package/dist/web/navigation.d.ts
CHANGED
|
@@ -1,73 +1,273 @@
|
|
|
1
|
-
import type { Document } from '../content/document.ts';
|
|
2
1
|
import type { SiteData } from './context.ts';
|
|
3
2
|
/**
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
3
|
+
* The menu a theme renders when nothing says which one it means: the menu that
|
|
4
|
+
* was the whole of `navigation` before menus had names (TASK-107).
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_MENU_NAME = "primary";
|
|
7
|
+
/**
|
|
8
|
+
* What one `rel` value may be spelled with: letters and dashes, which is what
|
|
9
|
+
* every HTML link type is spelled with.
|
|
10
|
+
*
|
|
11
|
+
* Deliberately not a list of the values this CMS knows about (TASK-114). The
|
|
12
|
+
* trailing part of a link line is whatever `rel` values the person typed —
|
|
13
|
+
* `me`, `nofollow`, `author`, `noopener`, one somebody's own reader looks for
|
|
14
|
+
* — and all of them reach the rendered attribute. A closed list would mean
|
|
15
|
+
* every value anybody wanted had to be added here first, and `me` was never a
|
|
16
|
+
* flag in the first place: it is a `rel` value that this CMS happened to be
|
|
17
|
+
* the only one to know.
|
|
18
|
+
*/
|
|
19
|
+
export declare const REL_VALUE_PATTERN: RegExp;
|
|
20
|
+
/**
|
|
21
|
+
* What a link line's trailing part may be, in the words both boxes explain it
|
|
22
|
+
* in, beside {@link LINK_URL_RULE}.
|
|
23
|
+
*/
|
|
24
|
+
export declare const LINK_REL_RULE = "the rel values the link carries, a word each \u2014 \"| me\", \"| nofollow noopener\"";
|
|
25
|
+
/**
|
|
26
|
+
* One bar-separated part as the `rel` values it names, or `undefined` when it
|
|
27
|
+
* is not a list of them.
|
|
28
|
+
*
|
|
29
|
+
* Every word has to be one: `nofollow noopener` is a list, `a=1|2`'s `2` is
|
|
30
|
+
* not, and that is what keeps a bar inside a URL a bar. An empty part names no
|
|
31
|
+
* values rather than an empty list, because `About | /about/ |` is a line with
|
|
32
|
+
* a trailing bar, not a line with a rel.
|
|
33
|
+
*/
|
|
34
|
+
export declare function relValuesOf(text: string): string[] | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Some `rel` values as one attribute holds them: lower case, each said once,
|
|
37
|
+
* in the order they were first typed.
|
|
38
|
+
*
|
|
39
|
+
* A theme prints this string and nothing else, so it never joins a list itself
|
|
40
|
+
* and never emits two `rel` attributes on one link. Lower case is what makes
|
|
41
|
+
* saying a value twice — `me` typed on a profile link that already carries it
|
|
42
|
+
* — a no-op rather than `rel="me ME"`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function relText(values: Iterable<string>): string;
|
|
45
|
+
/** A link line split at the point where its `rel` values begin. */
|
|
46
|
+
export interface LinkLine {
|
|
47
|
+
/** The line with its trailing `rel` values taken off: the label and the URL. */
|
|
48
|
+
text: string;
|
|
49
|
+
/** The values that were typed, as one attribute holds them. Empty for none. */
|
|
50
|
+
rel: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* One typed link line, with the `rel` values taken off the end of it.
|
|
54
|
+
*
|
|
55
|
+
* The values come off the right, one bar-separated part at a time, and only
|
|
56
|
+
* while the last part is a list of rel values — so `Mastodon |
|
|
57
|
+
* https://example.social/@me | me | nofollow` and `... | me nofollow` are the
|
|
58
|
+
* same line, and `Odd | /odd/?a=1|2` keeps its bar because `2` is not one.
|
|
6
59
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
60
|
+
* The one place a link line is split, for the reason the URL rule is worded
|
|
61
|
+
* once (TASK-114): the menu box on the Navigation screen and the Links box on
|
|
62
|
+
* a profile take the same line, so somebody who learns one box has learned the
|
|
63
|
+
* other.
|
|
11
64
|
*/
|
|
12
|
-
export declare
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
65
|
+
export declare function splitLinkRel(line: string): LinkLine;
|
|
66
|
+
/**
|
|
67
|
+
* What a menu name may be spelled with.
|
|
68
|
+
*
|
|
69
|
+
* A menu name is the word a theme writes after the dot in
|
|
70
|
+
* `{% for item in menus.footer %}`, and the key `site.json` stores that menu
|
|
71
|
+
* under. So it is an identifier before it is a slug: in a template
|
|
72
|
+
* `menus.top-bar` is `menus.top` minus `bar`, which renders nothing, raises
|
|
73
|
+
* nothing and leaves somebody looking at an empty page wondering which half is
|
|
74
|
+
* broken. A hyphen is refused here so that cannot happen.
|
|
75
|
+
*
|
|
76
|
+
* Lower case is the other half of the rule, and it is what refuses the
|
|
77
|
+
* spellings that would be confused with each other: `footer` and `Footer`
|
|
78
|
+
* would be two menus on the Navigation screen, one of them rendered nowhere,
|
|
79
|
+
* and no way to see the difference between them at a glance.
|
|
80
|
+
*/
|
|
81
|
+
export declare const MENU_NAME_PATTERN: RegExp;
|
|
82
|
+
/** The longest a menu name may be. Long enough for a phrase, short enough to read. */
|
|
83
|
+
export declare const MENU_NAME_MAX_LENGTH = 32;
|
|
84
|
+
/**
|
|
85
|
+
* What is wrong with a proposed menu name, or `undefined` when nothing is.
|
|
86
|
+
*
|
|
87
|
+
* The rule governs a name somebody types on the Navigation screen (TASK-108).
|
|
88
|
+
* A name a `theme.json` declares is a menu name by declaration and is shown as
|
|
89
|
+
* the theme spells it: the theme decides where its own menus go, and a screen
|
|
90
|
+
* that hid a declared area because it disliked the spelling would leave
|
|
91
|
+
* somebody unable to fill in a menu their site renders.
|
|
92
|
+
*/
|
|
93
|
+
export declare function menuNameProblem(name: string): string | undefined;
|
|
94
|
+
/** One entry of a menu, as `site.json` and the settings screen spell it. */
|
|
16
95
|
export interface NavigationItem {
|
|
17
96
|
/** The words on the link. */
|
|
18
97
|
label: string;
|
|
19
98
|
/** Where it goes: a site-root path, or an absolute URL for somewhere else. */
|
|
20
99
|
url: string;
|
|
100
|
+
/**
|
|
101
|
+
* What the link's `rel` attribute says, as one string holding every value:
|
|
102
|
+
* `me` for a profile that is you, `nofollow noopener` for somewhere you are
|
|
103
|
+
* only pointing at, whatever else a reader of this site looks for.
|
|
104
|
+
*
|
|
105
|
+
* Present only when there is something to say, so a `site.json` holding a
|
|
106
|
+
* plain `{ label, url }` is a complete item rather than one missing a key.
|
|
107
|
+
* Already lower case and deduplicated ({@link relText}), because a theme
|
|
108
|
+
* prints it as it stands and no theme should be joining a list or emitting
|
|
109
|
+
* two `rel` attributes on one link.
|
|
110
|
+
*/
|
|
111
|
+
rel?: string;
|
|
21
112
|
}
|
|
113
|
+
/** Every menu one site stores, by name. */
|
|
114
|
+
export type NavigationMenus = Record<string, NavigationItem[]>;
|
|
22
115
|
/** One entry of the menu a theme renders. */
|
|
23
116
|
export interface MenuItem extends NavigationItem {
|
|
24
117
|
/** Whether this is the page being looked at, for `aria-current`. */
|
|
25
118
|
current: boolean;
|
|
26
119
|
}
|
|
120
|
+
/** Every menu a theme renders, by name, marked for the page being rendered. */
|
|
121
|
+
export type MenuList = Record<string, MenuItem[]>;
|
|
27
122
|
/** What {@link navigationMenu} builds a menu out of. */
|
|
28
123
|
export interface NavigationMenuOptions {
|
|
29
|
-
/** The site data, whose `
|
|
124
|
+
/** The site data, whose `menus` hold every menu it has. */
|
|
30
125
|
site: SiteData;
|
|
31
|
-
/** The public pages, of which the ones that opted in join the menu. */
|
|
32
|
-
pages: readonly Document[];
|
|
33
126
|
/** The path being rendered, which is what marks an item current. */
|
|
34
127
|
url: string;
|
|
128
|
+
/** Which menu. {@link DEFAULT_MENU_NAME} when nothing says. */
|
|
129
|
+
name?: string | undefined;
|
|
35
130
|
}
|
|
36
|
-
/** The menu for one request: the explicit items, then the pages that opted in. */
|
|
37
|
-
export declare function navigationMenu(options: NavigationMenuOptions): MenuItem[];
|
|
38
131
|
/**
|
|
39
|
-
*
|
|
132
|
+
* One named menu for one request: the items the site stores under that name,
|
|
133
|
+
* with the one the request is on marked.
|
|
40
134
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
135
|
+
* The setting is the only source of a menu (TASK-106). A page cannot put
|
|
136
|
+
* itself in one, so there is one screen to edit a menu on, one order — the
|
|
137
|
+
* order the lines were typed in — and no way for one link to appear twice. A
|
|
138
|
+
* page that should be linked is linked by typing a line for it, including the
|
|
139
|
+
* page a site serves as its front page: that one is typed `Home | /`, the URL
|
|
140
|
+
* a reader lands on, rather than the permalink that redirects there.
|
|
47
141
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* there.
|
|
142
|
+
* A name the site has stored nothing under is an empty menu rather than an
|
|
143
|
+
* error: a theme declaring an area the site has not filled in yet renders
|
|
144
|
+
* nothing there, which is what an unfilled area should look like.
|
|
51
145
|
*/
|
|
52
|
-
export declare function
|
|
53
|
-
/**
|
|
54
|
-
export
|
|
146
|
+
export declare function navigationMenu(options: NavigationMenuOptions): MenuItem[];
|
|
147
|
+
/** What {@link navigationMenus} builds every menu out of. */
|
|
148
|
+
export interface NavigationMenusOptions {
|
|
149
|
+
/** The site data, whose `menus` hold every menu it has. */
|
|
150
|
+
site: SiteData;
|
|
151
|
+
/** The path being rendered, which is what marks an item current. */
|
|
152
|
+
url: string;
|
|
153
|
+
}
|
|
55
154
|
/**
|
|
56
|
-
*
|
|
155
|
+
* Every menu one site stores, by name, marked for this request: what the
|
|
156
|
+
* template context carries as `menus`.
|
|
157
|
+
*
|
|
158
|
+
* Every stored menu is here, not only the ones the theme in use declares an
|
|
159
|
+
* area for. The declaration in `theme.json` is what the Navigation screen
|
|
160
|
+
* reads to say where a menu can go (TASK-108); it is not a filter on the
|
|
161
|
+
* render, because a theme that renders a menu it forgot to declare should look
|
|
162
|
+
* wrong on the screen that lists areas rather than silently render nothing.
|
|
163
|
+
* A menu no template loops over is simply rendered nowhere, and kept.
|
|
164
|
+
*/
|
|
165
|
+
export declare function navigationMenus(options: NavigationMenusOptions): MenuList;
|
|
166
|
+
/**
|
|
167
|
+
* The items of one named menu, ignoring anything that is not one.
|
|
57
168
|
*
|
|
58
169
|
* Tolerant on the way out, the way `taxonomyBasesOrDefault` is: the settings
|
|
59
170
|
* screen refuses a malformed item, so anything unreadable here came from a
|
|
60
171
|
* hand-edited `site.json`, and a menu that quietly loses a line is a better
|
|
61
172
|
* answer than a site that will not render.
|
|
62
173
|
*/
|
|
63
|
-
export declare function navigationItems(site: SiteData): NavigationItem[];
|
|
174
|
+
export declare function navigationItems(site: SiteData, name?: string): NavigationItem[];
|
|
175
|
+
/**
|
|
176
|
+
* Every menu the site data stores, by name.
|
|
177
|
+
*
|
|
178
|
+
* The one place `site.menus` is read on the render side, the way
|
|
179
|
+
* {@link navigationItems} was the one place `site.navigation` was read before
|
|
180
|
+
* menus had names. The old key is not read at all: a site.json still carrying
|
|
181
|
+
* `navigation` has a key nothing looks at, which is what a rename means.
|
|
182
|
+
*/
|
|
183
|
+
export declare function siteMenus(site: SiteData): NavigationMenus;
|
|
184
|
+
/**
|
|
185
|
+
* A `menus` value as the menus it names, ignoring anything that is not one.
|
|
186
|
+
*
|
|
187
|
+
* One spelling for the site data a render reads and the `menus` the settings
|
|
188
|
+
* screen writes, so a menu means the same thing to the theme and to the form
|
|
189
|
+
* that edits it. Anything but a plain object — a list, a string, nothing at
|
|
190
|
+
* all — is a site with no menus; a name holding something that is not a list
|
|
191
|
+
* is a menu with nothing in it, because the name is still a menu this site
|
|
192
|
+
* holds and the Navigation screen has to be able to show it.
|
|
193
|
+
*/
|
|
194
|
+
export declare function menusOf(value: unknown): NavigationMenus;
|
|
64
195
|
/**
|
|
65
|
-
*
|
|
196
|
+
* One menu's stored value as the items it names, ignoring anything that is not
|
|
66
197
|
* one.
|
|
67
198
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
199
|
+
* `rel` is read through {@link relText}, so a file that wrote it in capitals
|
|
200
|
+
* or said a value twice renders one attribute either way, and a `rel` that is
|
|
201
|
+
* not a string is an item with none rather than an item dropped.
|
|
202
|
+
*
|
|
203
|
+
* `me: true` is still read, as `rel: "me"`. It is how every marked item was
|
|
204
|
+
* spelled before the trailing part of a line was a list of rel values
|
|
205
|
+
* (TASK-107, TASK-114), and a site that had set the only flag there was must
|
|
206
|
+
* not lose it on upgrade; the Navigation screen writes `rel` the next time
|
|
207
|
+
* that menu is saved. Only the literal `true` counts, the way it always did.
|
|
71
208
|
*/
|
|
72
209
|
export declare function navigationItemsOf(value: unknown): NavigationItem[];
|
|
210
|
+
/**
|
|
211
|
+
* One `Label | URL` line as a menu item, or `undefined` when it is not one.
|
|
212
|
+
*
|
|
213
|
+
* The URL is either a site-root path or an absolute http(s) URL: a bare
|
|
214
|
+
* `about/` would be resolved against whatever page it was printed on, which is
|
|
215
|
+
* never what a menu means.
|
|
216
|
+
*
|
|
217
|
+
* A line may end in the `rel` values the link carries — `Mastodon |
|
|
218
|
+
* https://example.social/@me | me`, `A source | https://example.com/thing |
|
|
219
|
+
* nofollow noopener` — which {@link splitLinkRel} takes off the end first.
|
|
220
|
+
*
|
|
221
|
+
* What is left splits at its first bar, so a label still cannot hold one.
|
|
222
|
+
*/
|
|
223
|
+
export declare function menuItemOf(line: string): NavigationItem | undefined;
|
|
224
|
+
/**
|
|
225
|
+
* A menu box as the ordered items it names, dropping the lines that are not
|
|
226
|
+
* items.
|
|
227
|
+
*
|
|
228
|
+
* Call {@link menuItemLineProblem} first where a person is waiting to be told:
|
|
229
|
+
* this is the tolerant read, which is what the old settings table's rows and a
|
|
230
|
+
* validated box both go through. `site.json` is read by {@link menusOf}
|
|
231
|
+
* instead, because the file holds objects rather than lines.
|
|
232
|
+
*/
|
|
233
|
+
export declare function menuItemsFromText(value: string): NavigationItem[];
|
|
234
|
+
/** The items as a box shows them: one line each, in order. */
|
|
235
|
+
export declare function menuItemsText(items: readonly NavigationItem[]): string;
|
|
236
|
+
/**
|
|
237
|
+
* What is wrong with a typed menu, or `undefined` when nothing is.
|
|
238
|
+
*
|
|
239
|
+
* One message naming the first bad line rather than a count of how many there
|
|
240
|
+
* are: a box is fixed a line at a time, and the line to fix is the useful
|
|
241
|
+
* half of the sentence.
|
|
242
|
+
*/
|
|
243
|
+
export declare function menuItemLineProblem(value: string): string | undefined;
|
|
244
|
+
/**
|
|
245
|
+
* What a URL typed into a link box may be, in the words both boxes explain it
|
|
246
|
+
* in: the menu on the Navigation screen and the Links on a user's profile.
|
|
247
|
+
*
|
|
248
|
+
* One sentence fragment rather than two, so the rule {@link isLinkUrl} applies
|
|
249
|
+
* is worded the same wherever somebody is told about it (TASK-112). Somebody
|
|
250
|
+
* who learns one box should not be taught the wrong thing about the other.
|
|
251
|
+
*/
|
|
252
|
+
export declare const LINK_URL_RULE = "a path like /about/ or an absolute http:// or https:// URL, with no spaces in it";
|
|
253
|
+
/**
|
|
254
|
+
* Whether a typed URL is one a link box accepts: a site-root path, or an
|
|
255
|
+
* absolute http(s) URL, and no whitespace either way.
|
|
256
|
+
*
|
|
257
|
+
* A bare `about/` would be resolved against whatever page it was printed on,
|
|
258
|
+
* which is never what a link box means, and a `javascript:` or `data:` URL is
|
|
259
|
+
* not somewhere a reader goes.
|
|
260
|
+
*
|
|
261
|
+
* The whitespace half is not decoration. `new URL` does not throw on
|
|
262
|
+
* `https://shll.me/@a | me`: it reads the space and the bar as path
|
|
263
|
+
* characters and percent-encodes them, so a check that only asked the parser
|
|
264
|
+
* took a label, a URL and a trailing word as one URL and stored it — which is
|
|
265
|
+
* how a reader of shll.me ended up at `/author/a%20%7C%20me/` (TASK-112). A
|
|
266
|
+
* URL somebody types has no spaces in it; a space means they typed two things.
|
|
267
|
+
*
|
|
268
|
+
* Deliberately a test rather than a normaliser: a link keeps the URL as it was
|
|
269
|
+
* typed, so `https://example.social/@me` is what the link says and what the
|
|
270
|
+
* box shows it back as.
|
|
271
|
+
*/
|
|
272
|
+
export declare function isLinkUrl(url: string): boolean;
|
|
73
273
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/web/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/web/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,QAAe,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,aAAa,0FACsD,CAAC;AAEjF;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAO9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,CAQxD;AAED,mEAAmE;AACnE,MAAM,WAAW,QAAQ;IACvB,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAcnD;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,QAAsB,CAAC;AAErD,sFAAsF;AACtF,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAmBhE;AAED,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC7B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