@dosgato/templating 1.1.4 → 1.1.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.
@@ -137,6 +137,16 @@ export interface APITemplate<DataType> {
137
137
  * and set it any time you encounter an id or reference.
138
138
  */
139
139
  onCopy?: (data: DataType, pageCopy: boolean, workspace: Record<string, any>) => void;
140
+ /**
141
+ * This is very similar to onCopy, but it is called when a page is being imported instead of
142
+ * copied. In this case it is possible but not guaranteed that the original page still exists.
143
+ *
144
+ * Usually you want to avoid regenerating ids during an import because export/import is about
145
+ * archiving and restoring pages, so we'd prefer to restore them exactly as they were. However,
146
+ * since the original can still exist, anything that MUST be globally unique should be regenerated,
147
+ * just in case.
148
+ */
149
+ onImport?: (data: DataType, workspace: Record<string, any>) => void;
140
150
  /**
141
151
  * The available component list in the main content area can get very long, among others. Therefore, each
142
152
  * template may set a displayCategory and any templates that share a displayCategory will be grouped together
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosgato/templating",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "A library to support building templates for dosgato CMS.",
5
5
  "type": "module",
6
6
  "exports": {