@dosgato/templating 0.0.87 → 0.0.89

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,7 @@ export declare abstract class Component<DataType extends ComponentData = any, Fe
168
168
  */
169
169
  renderRichText: (html: string, opts?: {
170
170
  headerLevel?: number;
171
- advanceHeader?: string | undefined | null;
171
+ advanceHeader?: string;
172
172
  }) => string;
173
173
  /**
174
174
  * The final phase of rendering a component is the render phase. This step is BOTTOM-UP -
@@ -502,7 +502,7 @@ export interface RenderedComponent<C extends Component = Component> {
502
502
  component: C;
503
503
  output: string;
504
504
  }
505
- export declare abstract class Page<DataType extends PageData = any, FetchedType = any, RenderContextType extends ContextBase = any> extends Component<DataType, FetchedType, RenderContextType> {
505
+ export declare abstract class Page<DataType extends PageData = any, FetchedType = any, RenderContextType extends ContextBase = ContextBase> extends Component<DataType, FetchedType, RenderContextType> {
506
506
  /**
507
507
  * The page id in case you need to pass it to the API, e.g. this.api.getRootPage(this.id)
508
508
  * in a page template or this.api.getRootPage(this.page.id) in a component template.
@@ -66,6 +66,27 @@ export interface UITemplate {
66
66
  * preview image.
67
67
  */
68
68
  icon?: IconOrSVG;
69
+ /**
70
+ * Add buttons to the page bar in the page editing UI when editing pages with this
71
+ * template. Only applies to page templates.
72
+ *
73
+ * When clicked, the button will send a message to the page iframe. The message content
74
+ * will contain the label, like this:
75
+ *
76
+ * { action: 'pagebar', label: 'yourlabel' }
77
+ *
78
+ * There should be code, generated by this template, that listens for such a message and
79
+ * takes your desired action.
80
+ */
81
+ pageBarButtons?: {
82
+ icon?: IconOrSVG;
83
+ label: string;
84
+ /**
85
+ * Set true if the button should only appear as an icon. `label` is still required for
86
+ * screen reader support.
87
+ */
88
+ hideLabel?: boolean;
89
+ }[];
69
90
  }
70
91
  /**
71
92
  * This is a type for the data that will be passed to dialog Svelte components as
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosgato/templating",
3
- "version": "0.0.87",
3
+ "version": "0.0.89",
4
4
  "description": "A library to support building templates for dosgato CMS.",
5
5
  "type": "module",
6
6
  "exports": {