@velastack/cms 0.2.4 → 0.2.6

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.
@@ -226,7 +226,8 @@
226
226
  data-popover-open={pageSelectOpen ? '' : undefined}
227
227
  >
228
228
  {#if children}
229
- <span class="cms-link-edit__custom">
229
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
230
+ <span class="cms-link-edit__custom" onclickcapture={blockNav}>
230
231
  {@render children(renderProps)}
231
232
  </span>
232
233
  {:else}
@@ -390,6 +391,15 @@
390
391
  white-space: nowrap;
391
392
  font-family: ui-sans-serif, system-ui, sans-serif;
392
393
  }
394
+ /* Bridge the gap between the link and the toolbar so hover isn't lost crossing it. */
395
+ .cms-link-edit__toolbar::after {
396
+ content: '';
397
+ position: absolute;
398
+ top: 100%;
399
+ left: 0;
400
+ right: 0;
401
+ height: 0.5rem;
402
+ }
393
403
  .cms-link-edit:hover .cms-link-edit__toolbar,
394
404
  .cms-link-edit:focus-within .cms-link-edit__toolbar,
395
405
  .cms-link-edit[data-popover-open] .cms-link-edit__toolbar {
@@ -43,6 +43,12 @@
43
43
  </script>
44
44
 
45
45
  {#if editable && ref}
46
+ <!-- Mounted straight into edit mode (navigation while editing): the
47
+ children branch below never rendered, so render it hidden once to
48
+ capture the default markup. Removed as soon as it's captured. -->
49
+ {#if children && initialFromChildren === undefined}
50
+ <div bind:this={childrenEl} class="cms-rich-text-capture">{@render children()}</div>
51
+ {/if}
46
52
  {#await import('./cms-rich-text-editable.svelte') then { default: Editable }}
47
53
  <Editable scope={ref} {name} initial={editInitial} />
48
54
  {/await}
@@ -63,6 +69,9 @@
63
69
  .cms-rich-text-children {
64
70
  display: contents;
65
71
  }
72
+ .cms-rich-text-capture {
73
+ display: none;
74
+ }
66
75
  .cms-missing {
67
76
  padding: 0.25rem 0.5rem;
68
77
  border: 1px dashed rgba(127, 127, 127, 0.6);
@@ -73,6 +73,12 @@
73
73
  </script>
74
74
 
75
75
  {#if editable && ref}
76
+ <!-- Mounted straight into edit mode (navigation while editing): the
77
+ children branch below never rendered, so render it hidden once to
78
+ capture the default text. Removed as soon as it's captured. -->
79
+ {#if children && initialFromChildren === undefined}
80
+ <span bind:this={childrenEl} class="cms-text-capture">{@render children()}</span>
81
+ {/if}
76
82
  <span
77
83
  bind:this={el}
78
84
  class="cms-text-editable"
@@ -118,6 +124,9 @@
118
124
  .cms-text-children {
119
125
  display: contents;
120
126
  }
127
+ .cms-text-capture {
128
+ display: none;
129
+ }
121
130
 
122
131
  .cms-missing {
123
132
  display: inline-block;
@@ -56,6 +56,13 @@ export type MockAdapterOptions = {
56
56
  * pending edits onto published content.
57
57
  */
58
58
  resolvePreview?: (previewKey: string) => ReleaseSnapshot | null | undefined;
59
+ /**
60
+ * Surfaced as `CmsPayload.endpoint` so the admin bar signs in against a
61
+ * hosted CMS even when content is served from memory — a static site built
62
+ * offline (`VELA_CMS_OFFLINE=1`) with fallbacks, whose editors still need
63
+ * somewhere to sign in. Unset, the loader falls back to `/api/cms`.
64
+ */
65
+ endpoint?: string;
59
66
  };
60
67
  /**
61
68
  * In-memory {@link CmsAdapter} useful for tests, demos, and local development
@@ -62,6 +62,7 @@ export const mockAdapter = (options = {}) => {
62
62
  const pageDocs = options.pageDocs ?? {};
63
63
  const resolvePreview = options.resolvePreview;
64
64
  return {
65
+ ...(options.endpoint ? { endpoint: options.endpoint } : {}),
65
66
  fetchDocs(queries, context) {
66
67
  const previewKey = context.previewKey;
67
68
  const release = previewKey && resolvePreview ? resolvePreview(previewKey) : null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velastack/cms",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "A scope-aware CMS for SvelteKit, for static or dynamic sites.",
5
5
  "keywords": [
6
6
  "svelte",