@dosgato/templating 1.1.8 → 1.1.10

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.
Files changed (2) hide show
  1. package/dist/render.d.ts +19 -5
  2. package/package.json +1 -1
package/dist/render.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ContextBase, DataRecord, PageData, PageRecord, PageRecordNoData, PageRecordOptionalData } from './component.js';
1
+ import type { ContextBase, DataRecord, PageData, PageRecord, PageRecordNoData, SiteInfo } from './component.js';
2
2
  import type { AssetFolderLink, AssetLink, DataFolderLink, DataLink, LinkDefinition, PageLink } from './links.js';
3
3
  /**
4
4
  * Safely encapsulates `content` in header tags based on the `ctx` context passed and adds any passed `attributes` to the header tagging.
@@ -134,7 +134,13 @@ export interface APIClient {
134
134
  * broken, but if a site has launch info that is simply disabled, getHref will still work. Any links generated
135
135
  * would work as soon as the launch info is enabled.
136
136
  */
137
- getHref: (page: PageRecordOptionalData, opts?: {
137
+ getHref: (page: {
138
+ path: string;
139
+ site: SiteInfo;
140
+ pagetree: {
141
+ id: string;
142
+ };
143
+ }, opts?: {
138
144
  absolute?: boolean;
139
145
  extension?: string;
140
146
  }) => string | undefined;
@@ -151,7 +157,13 @@ export interface APIClient {
151
157
  * Based on that boolean, components can be configured to render a shiny red warning message in edit mode
152
158
  * so that editors can quickly identify broken links on their pages.
153
159
  */
154
- getHrefPlus: (page: PageRecordOptionalData, opts?: {
160
+ getHrefPlus: (page: {
161
+ path: string;
162
+ site: SiteInfo;
163
+ pagetree: {
164
+ id: string;
165
+ };
166
+ }, opts?: {
155
167
  absolute?: boolean;
156
168
  extension?: string;
157
169
  }) => {
@@ -201,8 +213,10 @@ export interface APIClient {
201
213
  * Helpful for evaluating links when you need more than just an href like you'd get from `resolveLink`.
202
214
  */
203
215
  getPageNoData: ({ link }: {
204
- link?: string | PageLink;
205
- }) => Promise<PageRecordNoData | undefined>;
216
+ link: string | PageLink;
217
+ }) => Promise<PageRecordNoData & {
218
+ title: string;
219
+ } | undefined>;
206
220
  /** Get all ancestor pages of a specific page. First array element will be the pagetree root page. */
207
221
  getAncestors: ({ id, path }: {
208
222
  id?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosgato/templating",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "A library to support building templates for dosgato CMS.",
5
5
  "type": "module",
6
6
  "exports": {