astro-tractstack 2.0.22 → 2.0.23

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,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-tractstack",
3
- "version": "2.0.22",
3
+ "version": "2.0.23",
4
4
  "description": "Astro integration for TractStack - redeeming the web from boring experiences",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -202,7 +202,10 @@ export const NodeAnchorComponent = (props: NodeProps, tagName: string) => {
202
202
  onDoubleClick={handleDoubleClick}
203
203
  data-editable-link="true"
204
204
  // Preserve display mode
205
- style={{ display: 'inline' }}
205
+ style={{
206
+ display: 'inline',
207
+ cursor: isEditMode ? 'text' : 'pointer',
208
+ }}
206
209
  >
207
210
  <RenderChildren
208
211
  children={ctx.getChildNodeIDs(nodeId)}
@@ -147,7 +147,9 @@ function extractNodesFromDOM(
147
147
  if (text !== null && text !== undefined) {
148
148
  // Remove zero-width spaces
149
149
  text = text.replace(/\u200B/g, '');
150
-
150
+ if (text.trim() === '') {
151
+ return;
152
+ }
151
153
  result.push({
152
154
  id: ulid(),
153
155
  parentId,
@@ -361,16 +363,16 @@ export function processRichTextToNodes(
361
363
  if (['a', 'button', 'span'].includes(node.tagName)) {
362
364
  const matchingOriginalNode = findMatchingNode(node, originalNodes);
363
365
  if (matchingOriginalNode) {
364
- if (node.tagName === 'a') {
366
+ if (['a', 'button'].includes(node.tagName)) {
365
367
  if (matchingOriginalNode.href) {
366
368
  node.href = matchingOriginalNode.href;
367
369
  }
368
- } else if (node.tagName === 'button') {
369
370
  node.buttonPayload = matchingOriginalNode.buttonPayload;
370
371
  } else if (node.tagName === 'span') {
371
372
  node.elementCss = matchingOriginalNode.elementCss;
372
373
  node.overrideClasses = matchingOriginalNode.overrideClasses;
373
374
  }
375
+ console.log(node);
374
376
  } else if (onInsertSignal) {
375
377
  // New interactive element detected, trigger insert signal
376
378
  onInsertSignal(node.tagName, node.id);