@dosgato/templating 0.0.2 → 0.0.5

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.
@@ -1,16 +1,20 @@
1
1
  import { PageWithAncestors, ComponentData } from './component';
2
2
  import { LinkDefinition } from './links';
3
- export declare type TemplateType = 'page' | 'component' | 'data';
3
+ export declare type APITemplateType = 'page' | 'component' | 'data';
4
4
  /**
5
5
  * This interface lays out the structure the API needs for each template in the system.
6
6
  */
7
- export interface Template {
8
- type: TemplateType;
7
+ export interface APITemplate {
8
+ type: APITemplateType;
9
9
  /**
10
10
  * A unique string to globally identify this template across installations. Namespacing like
11
11
  * edu.txstate.RichTextEditor could be useful but no special format is required.
12
12
  */
13
13
  templateKey: string;
14
+ /**
15
+ * A uniquey human-readable name describing this template
16
+ */
17
+ name: string;
14
18
  /**
15
19
  * Each template must declare its areas and the template keys of components that will be
16
20
  * permitted inside each area. The list of allowed component templates can be updated beyond
@@ -48,6 +52,16 @@ export interface Template {
48
52
  * names.
49
53
  */
50
54
  validate: (data: any) => Promise<Record<string, string[]>>;
55
+ /**
56
+ * Hard-coded properties that may be set on page templates to influence the rendering of
57
+ * components on the page. For instance, a set of color choices that are customized for
58
+ * each template design. Components on the page may refer to the color information stored
59
+ * in the template during dialogs and while rendering. Changing to a different page template
60
+ * could then result in different color choices for components like buttons.
61
+ *
62
+ * Must be null for non-page templates.
63
+ */
64
+ templateProperties?: any;
51
65
  }
52
66
  /**
53
67
  * In dosgato CMS, the data in the database is not altered except during user activity. This
File without changes
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
+ export * from './apitemplate';
1
2
  export * from './component';
2
3
  export * from './links';
3
4
  export * from './page';
4
5
  export * from './provider';
5
- export * from './template';
package/dist/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -10,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
15
  };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./apitemplate"), exports);
13
18
  __exportStar(require("./component"), exports);
14
19
  __exportStar(require("./links"), exports);
15
20
  __exportStar(require("./page"), exports);
16
21
  __exportStar(require("./provider"), exports);
17
- __exportStar(require("./template"), exports);
package/dist/links.d.ts CHANGED
@@ -18,6 +18,7 @@ export interface AssetLink {
18
18
  */
19
19
  export interface AssetFolderLink {
20
20
  type: 'assetfolder';
21
+ source: string;
21
22
  id: string;
22
23
  siteId: string;
23
24
  path: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosgato/templating",
3
- "version": "0.0.2",
3
+ "version": "0.0.5",
4
4
  "description": "A library to support building templates for dosgato CMS.",
5
5
  "exports": {
6
6
  "require": "./dist/index.js",