@dosgato/templating 0.0.83 → 0.0.84

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/render.js CHANGED
@@ -6,7 +6,7 @@ export function printHeader(ctx, content) {
6
6
  if (level < 1)
7
7
  return `<h1>${content}</h1>`;
8
8
  if (level > 6)
9
- return `<h6>${content}</h1>`;
9
+ return `<h6>${content}</h6>`;
10
10
  return `<h${level}>${content}</h${level}>`;
11
11
  }
12
12
  export function advanceHeader(ctx, content) {
@@ -1,4 +1,4 @@
1
- import { ComponentData } from './component.js';
1
+ import { ComponentData, PageData } from './component.js';
2
2
  interface IconifyIcon {
3
3
  body: string;
4
4
  rotate?: number;
@@ -26,6 +26,8 @@ export interface UITemplate {
26
26
  * - creating: boolean, true when creating component for the first time, false when editing
27
27
  * - data: ComponentData, the current data on the page, should not be mutated during editing,
28
28
  * undefined when creating
29
+ * - page: DialogPageProp, the current page so that you can reference the full page data or
30
+ * make a further graphql query based on its id/path.
29
31
  * - templateProperties: the template properties for the current page template, so you can make
30
32
  * things like color pickers that visually match the colors of the current page template
31
33
  * - environmentConfig: base URLs in case you need to generate a link to the API or something
@@ -60,4 +62,18 @@ export interface UITemplate {
60
62
  */
61
63
  icon?: IconOrSVG;
62
64
  }
65
+ /**
66
+ * This is a type for the data that will be passed to dialog Svelte components as
67
+ * the `page` prop.
68
+ */
69
+ export interface DialogPageProp {
70
+ id: string;
71
+ path: string;
72
+ data: PageData;
73
+ }
74
+ /**
75
+ * A function you may use in your dialogs to make an authenticated graphql request to the DosGato
76
+ * API.
77
+ */
78
+ export declare function dialogQuery<T = any>(query: string, variables: any): Promise<T>;
63
79
  export {};
@@ -1 +1,7 @@
1
- export {};
1
+ /**
2
+ * A function you may use in your dialogs to make an authenticated graphql request to the DosGato
3
+ * API.
4
+ */
5
+ export async function dialogQuery(query, variables) {
6
+ return await window.api.query(query, variables);
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosgato/templating",
3
- "version": "0.0.83",
3
+ "version": "0.0.84",
4
4
  "description": "A library to support building templates for dosgato CMS.",
5
5
  "type": "module",
6
6
  "exports": {