@the-smithy/hearth-schema 0.23.0 → 0.24.1

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +17 -3
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -3176,14 +3176,28 @@ type BlockOf<T extends Exclude<BlockType, "sharedBlock">> = Extract<KnownBlock,
3176
3176
  type: T;
3177
3177
  }>;
3178
3178
  /**
3179
- * One of the site's global blocks (GET /global-blocks): edited once in Hearth and shown anywhere. `popup` is set when
3180
- * editors made it a pop-up: render it in a dialog that links to `#popup-<key>` open (and a floating button when
3181
- * `popup.button` is set). Menu items name one in `dropdown`. Frontends can also place any by key.
3179
+ * One of the site's global blocks (GET /global-blocks, or one by key or id at GET /global-blocks/{key or id}): edited
3180
+ * once in Hearth and shown anywhere. Place any of them wherever the site needs one; Hearth's own placements say where
3181
+ * editors put it: `popup` (render it in a dialog that links to `#popup-<key>` open, with a floating button when
3182
+ * `popup.button` is set) and `usedOn.menuItems` (main menu items whose `dropdown` names it).
3182
3183
  */
3183
3184
  type GlobalBlock = {
3185
+ id: string;
3186
+ /** Fixed once made: refer to it by this in code. */
3184
3187
  key: string;
3185
3188
  name: string;
3189
+ /** The block's type ("form", "cta"…), as on `block.type`. */
3190
+ type: string;
3191
+ /** For a `custom` block, the site's custom block it is (its key); otherwise null. */
3192
+ customBlock: string | null;
3186
3193
  popup: GlobalPopup | null;
3194
+ /** Where editors placed it: the live pages it's on (paths) and the main menu items it drops down from (labels). */
3195
+ usedOn: {
3196
+ pages: string[];
3197
+ menuItems: string[];
3198
+ };
3199
+ publishedAt: string | null;
3200
+ updatedAt: string;
3187
3201
  block: ResolvedBlock;
3188
3202
  };
3189
3203
  /** Where a site's tracker sends page views (<HearthAnalytics /> from `@the-smithy/hearth/analytics`). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-smithy/hearth-schema",
3
- "version": "0.23.0",
3
+ "version": "0.24.1",
4
4
  "description": "Content schemas and API types shared by Hearth and its SDK.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",