@platecms/delta-cast 0.13.0 → 1.2.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@platecms/delta-cast",
3
3
  "description": "Package containing the definition of CAST",
4
- "version": "0.13.0",
4
+ "version": "1.2.0",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -22,6 +22,6 @@
22
22
  "tslib": "2.8.1"
23
23
  },
24
24
  "peerDependencies": {
25
- "@platecms/delta-plate-resource-notation": "0.13.0"
25
+ "@platecms/delta-plate-resource-notation": "1.2.0"
26
26
  }
27
27
  }
@@ -174,9 +174,38 @@
174
174
  },
175
175
  {
176
176
  "$ref": "#/definitions/InternalLink"
177
+ },
178
+ {
179
+ "$ref": "#/definitions/ContentValueSuggestion"
177
180
  }
178
181
  ]
179
182
  },
183
+ "ContentValueSuggestion": {
184
+ "properties": {
185
+ "data": {
186
+ "$ref": "#/definitions/Data",
187
+ "description": "Info from the ecosystem."
188
+ },
189
+ "position": {
190
+ "$ref": "#/definitions/Position",
191
+ "description": "Position of a node in a source document.\n\nNodes that are generated (not in the original source document) must not\nhave a position."
192
+ },
193
+ "prn": {
194
+ "description": "The PRN (identifier) of the referenced Content Value.",
195
+ "type": "string"
196
+ },
197
+ "type": {
198
+ "const": "contentValueSuggestion",
199
+ "description": "Node type.",
200
+ "type": "string"
201
+ },
202
+ "value": {
203
+ "$ref": "#/definitions/Root",
204
+ "description": "The nested CAST tree of the referenced Content Value."
205
+ }
206
+ },
207
+ "type": "object"
208
+ },
180
209
  "Data": {
181
210
  "description": "Info associated with nodes by the ecosystem.\n\nThis space is guaranteed to never be specified by unist or specifications\nimplementing unist.\nBut you can use it in utilities and plugins to store data.\n\nThis type can be augmented to register custom data.\nFor example:\n\n```ts\ndeclare module 'unist' {\n interface Data {\n // `someNode.data.myId` is typed as `number | undefined`\n myId?: number | undefined\n }\n}\n```",
182
211
  "type": "object"
@@ -305,6 +334,9 @@
305
334
  },
306
335
  "InlineContent": {
307
336
  "anyOf": [
337
+ {
338
+ "$ref": "#/definitions/CasSuggestion"
339
+ },
308
340
  {
309
341
  "$ref": "#/definitions/Bold"
310
342
  },
@@ -334,6 +366,9 @@
334
366
  },
335
367
  {
336
368
  "$ref": "#/definitions/InternalLink"
369
+ },
370
+ {
371
+ "$ref": "#/definitions/ContentValueSuggestion"
337
372
  }
338
373
  ]
339
374
  },
@@ -26,6 +26,8 @@ export interface InlineContentMap {
26
26
  contentValue: InterpolatedContentValue;
27
27
  externalLink: ExternalLink;
28
28
  internalLink: InternalLink;
29
+ casSuggestion: CasSuggestion;
30
+ contentValueSuggestion: ContentValueSuggestion;
29
31
  }
30
32
 
31
33
  export interface Parent extends UnistParent {
@@ -200,6 +202,20 @@ export interface InterpolatedContentValue extends Node {
200
202
  value?: Root;
201
203
  }
202
204
 
205
+ export interface ContentValueSuggestion extends Node {
206
+ type: "contentValueSuggestion";
207
+
208
+ /**
209
+ * The PRN (identifier) of the referenced Content Value.
210
+ */
211
+ prn: string;
212
+
213
+ /**
214
+ * The nested CAST tree of the referenced Content Value.
215
+ */
216
+ value?: Root;
217
+ }
218
+
203
219
  export interface ExternalLink extends Parent {
204
220
  type: "externalLink";
205
221
 
@@ -52,7 +52,7 @@ describe("validateCast", () => {
52
52
  ],
53
53
  [
54
54
  "valid interpolated content value",
55
- { type: "contentValue", prn: "prn:plate-dev:1234:cxc:test:abcd" } satisfies InterpolatedContentValue,
55
+ { type: "contentValue", prn: "prn:plate-dev:1234:cms:test:abcd" } satisfies InterpolatedContentValue,
56
56
  ],
57
57
  [
58
58
  "valid external link",
@@ -67,7 +67,7 @@ describe("validateCast", () => {
67
67
  {
68
68
  type: "internalLink",
69
69
  url: "https://www.hotet.getplate.rocks/blogs",
70
- prn: "prn:plate-dev:1234:cxc:test:abcd",
70
+ prn: "prn:plate-dev:1234:cms:test:abcd",
71
71
  children: [{ type: "text", value: "Internal link" }],
72
72
  } satisfies InternalLink,
73
73
  ],
@@ -76,7 +76,7 @@ describe("validateCast", () => {
76
76
  {
77
77
  type: "internalLink",
78
78
  url: "https://www.hotet.getplate.rocks/blogs#123",
79
- prn: "prn:plate-dev:1234:cxc:test:abcd",
79
+ prn: "prn:plate-dev:1234:cms:test:abcd",
80
80
  children: [{ type: "text", value: "Internal link" }],
81
81
  } satisfies InternalLink,
82
82
  ],
@@ -213,7 +213,7 @@ function assertValidContent(value: unknown): asserts value is Content {
213
213
 
214
214
  /**
215
215
  * Validates a CAST object.
216
- * @remarks Doesn't (and can't) check for circular references. This is done in the Content Experience Center when validating the CAST.
216
+ * @remarks Doesn't (and can't) check for circular references. This is done in the Content Management Center when validating the CAST.
217
217
  */
218
218
  export function validateCast(value: unknown): void {
219
219
  assertNonNullObject(value);