@dosgato/templating 0.0.46 → 0.0.49

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.
@@ -168,7 +168,6 @@ export declare abstract class Component<DataType extends ComponentData = any, Fe
168
168
  */
169
169
  static editBar: (path: string, opts: EditBarOpts) => string;
170
170
  static newBar: (path: string, opts: EditBarOpts) => string;
171
- static repairHTML: (html: string) => string;
172
171
  constructor(data: DataType, path: string, parent: Component | undefined, editMode: boolean);
173
172
  areas: Map<string, Component<any, any, any>[]>;
174
173
  data: Omit<DataType, 'areas'>;
package/dist/links.d.ts CHANGED
@@ -26,9 +26,20 @@ export interface AssetFolderLink {
26
26
  */
27
27
  export interface PageLink {
28
28
  type: 'page';
29
+ siteId: string;
29
30
  linkId: string;
30
31
  path: string;
31
32
  }
33
+ /**
34
+ * When looking up a page by linkId, the context matters. For instance, if I'm
35
+ * gathering data to helps render a page that's in the same site as the target
36
+ * page, I want to be sure to get the version of the page from the same pagetree.
37
+ */
38
+ export interface PageLinkWithContext extends PageLink {
39
+ context?: {
40
+ pagetreeId: string;
41
+ };
42
+ }
32
43
  /**
33
44
  * The link format for external webpages. This format seems a little extra since
34
45
  * it's just a URL string. Why does it need to be an object with a type? However,
package/dist/render.d.ts CHANGED
@@ -46,7 +46,10 @@ export interface APIClient {
46
46
  * method to convert a link, as input by a user, into a URL suitable for an href, or optionally
47
47
  * an absolute URL suitable for a backend http request or non-HTML document like an RSS feed.
48
48
  */
49
- resolveLink: (link: string | LinkDefinition, absolute?: boolean) => Promise<string>;
49
+ resolveLink: (lnk: string | LinkDefinition, opts?: {
50
+ absolute?: boolean;
51
+ extension?: string;
52
+ }) => Promise<string>;
50
53
  /**
51
54
  * This function will be provided by the rendering server and should be used inside your fetch
52
55
  * method to prepare editor-provided HTML for rendering. It will do things like find and resolve
@@ -73,7 +76,7 @@ export interface APIClient {
73
76
  id?: string;
74
77
  path?: string;
75
78
  link?: string | PageLink;
76
- }) => Promise<PageRecord<PageData>>;
79
+ }) => Promise<PageRecord<PageData> | undefined>;
77
80
  /** Get all ancestor pages of a specific page. First array element will be the pagetree root page. */
78
81
  getAncestors: ({ id, path }: {
79
82
  id?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosgato/templating",
3
- "version": "0.0.46",
3
+ "version": "0.0.49",
4
4
  "description": "A library to support building templates for dosgato CMS.",
5
5
  "type": "module",
6
6
  "exports": {