@datocms/svelte 4.2.11 → 4.2.12

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.
@@ -7,6 +7,7 @@ export let currentPath = void 0;
7
7
  export let enableClickToEdit = void 0;
8
8
  export let stripStega = void 0;
9
9
  export let root = void 0;
10
+ export let hue = void 0;
10
11
  let controller = null;
11
12
  let onNavigateToCallback = onNavigateTo;
12
13
  $:
@@ -21,7 +22,9 @@ onMount(() => {
21
22
  // Optionally limit scanning to a specific root
22
23
  root,
23
24
  // Control stega encoding stripping behavior
24
- ...stripStega !== void 0 ? { stripStega } : {}
25
+ ...stripStega !== void 0 ? { stripStega } : {},
26
+ // Optionally customize the overlay accent color
27
+ ...hue !== void 0 ? { hue } : {}
25
28
  });
26
29
  if (enableClickToEdit && typeof window !== "undefined" && window.self === window.top && (enableClickToEdit === true || !enableClickToEdit.hoverOnly || window.matchMedia("(hover: hover)").matches)) {
27
30
  controller.enableClickToEdit(
@@ -61,6 +61,11 @@ declare const __propDef: {
61
61
  * Ref to limit scanning to this root instead of document.
62
62
  * Useful for limiting the scope of content link detection to a specific container.
63
63
  */ root?: ParentNode | undefined;
64
+ /**
65
+ * Hue (0–359) of the overlay accent color.
66
+ *
67
+ * @default 17 (orange)
68
+ */ hue?: number | undefined;
64
69
  };
65
70
  events: {
66
71
  [evt: string]: CustomEvent<any>;
@@ -188,6 +188,7 @@ The `scrollToNearestTarget` parameter scrolls to the nearest editable element, u
188
188
  | `enableClickToEdit` | `boolean \| ClickToEditOptions` | - | Enable click-to-edit overlays on mount. Pass `true` or an object with options. If undefined or false, click-to-edit is disabled |
189
189
  | `stripStega` | `boolean` | - | Whether to strip stega encoding from text nodes after stamping |
190
190
  | `root` | `ParentNode` | - | Root element to limit scanning to instead of the entire document |
191
+ | `hue` | `number` | `17` | Hue (0–359) of the overlay accent color. Default is the DatoCMS hue (`17`). Use this to match your brand or project colors |
191
192
 
192
193
  ### ClickToEditOptions
193
194
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datocms/svelte",
3
- "version": "4.2.11",
3
+ "version": "4.2.12",
4
4
  "description": "A set of components and utilities to work faster with DatoCMS in Svelte",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "type": "module",
68
68
  "dependencies": {
69
- "@datocms/content-link": "^0.3.13",
69
+ "@datocms/content-link": "^0.3.19",
70
70
  "datocms-listen": "^1.0.2",
71
71
  "datocms-structured-text-utils": "^5.1.6",
72
72
  "svelte-intersection-observer": "^1.0.0"