uncial 2.0.0 → 2.0.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.
@@ -81,6 +81,7 @@
81
81
  });
82
82
  let draggingChildIndex = $state<number | null>(null);
83
83
  let draggingPointerId = $state<number | null>(null);
84
+ let panelElement = $state<HTMLElement>();
84
85
 
85
86
  function moveUp(index: number): void {
86
87
  if (index > 0) controller.moveContainerChild(index, index - 1);
@@ -129,7 +130,12 @@
129
130
 
130
131
  function handleChildDragMove(event: PointerEvent): void {
131
132
  if (draggingChildIndex === null || draggingPointerId !== event.pointerId) return;
132
- const target = document
133
+ // Hit-test from the panel's own root: inside the web component's shadow
134
+ // tree, `document.elementFromPoint` retargets to the host element and the
135
+ // list items are never found.
136
+ const root = panelElement?.getRootNode();
137
+ const scope = root instanceof ShadowRoot ? root : document;
138
+ const target = scope
133
139
  .elementFromPoint(event.clientX, event.clientY)
134
140
  ?.closest('[data-child-index]');
135
141
  if (!(target instanceof HTMLElement)) return;
@@ -161,7 +167,7 @@
161
167
  onpointercancel={stopChildDrag}
162
168
  />
163
169
 
164
- <div class="uncial-attrs-panel">
170
+ <div class="uncial-attrs-panel" bind:this={panelElement}>
165
171
  {#if controllerState.link.open}
166
172
  <LinkAttributesPanel
167
173
  attrs={controllerState.link.attrs}
@@ -60,14 +60,21 @@
60
60
  overflow-y: auto;
61
61
  }
62
62
 
63
+ /* Pinned to the top of the screen so the controls stay in reach however far
64
+ down a long document the caret sits. Opaque, because the document scrolls
65
+ beneath it; layered above the block handles (z 10) and below the overlay
66
+ sidebar (z 30). */
63
67
  .uncial-toolbar {
64
68
  grid-area: toolbar;
69
+ position: sticky;
70
+ top: 0;
71
+ z-index: 20;
65
72
  display: flex;
66
73
  flex-wrap: wrap;
67
74
  align-items: center;
68
75
  gap: var(--uncial-toolbar-gap);
69
76
  border-bottom: 1px solid var(--uncial-color-border);
70
- background: color-mix(in srgb, var(--uncial-color-surface-elevated) 60%, transparent);
77
+ background: var(--uncial-color-surface-elevated);
71
78
  padding: var(--uncial-space-2) var(--uncial-space-3);
72
79
  }
73
80
 
@@ -112,6 +112,8 @@
112
112
 
113
113
  .uncial-btn--drag {
114
114
  cursor: grab;
115
+ /* Pointer-driven reorder: a touch drag must not scroll the panel instead. */
116
+ touch-action: none;
115
117
  }
116
118
 
117
119
  .uncial-text--danger,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uncial",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -54,6 +54,7 @@
54
54
  "./styles/base": "./dist/styles/base.css",
55
55
  "./styles/controls": "./dist/styles/controls.css",
56
56
  "./styles/prose": "./dist/styles/prose.css",
57
+ "./styles/*.css": "./dist/styles/*.css",
57
58
  "./runtime/svelte": {
58
59
  "types": "./dist/runtime/svelte.d.ts",
59
60
  "svelte": "./dist/runtime/svelte.js",
@@ -119,7 +120,7 @@
119
120
  "dev": "vite dev",
120
121
  "build": "vite build",
121
122
  "preview": "vite preview",
122
- "package": "svelte-kit sync && svelte-package",
123
+ "package": "svelte-kit sync && svelte-package --tsconfig ./tsconfig.package.json",
123
124
  "changeset": "changeset",
124
125
  "version": "changeset version",
125
126
  "release": "pnpm run prepack && changeset publish",