@valbuild/shared 0.152.1 → 0.153.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.
- package/CHANGELOG.md +50 -0
- package/client/dist/valbuild-shared-client.cjs.dev.js +4 -1
- package/client/dist/valbuild-shared-client.cjs.prod.js +4 -1
- package/client/dist/valbuild-shared-client.esm.js +1 -1
- package/dist/declarations/src/client/index.d.ts +1 -0
- package/dist/declarations/src/internal/ApiRoutes.d.ts +123 -100
- package/dist/declarations/src/internal/codeChangedEvent.d.ts +15 -0
- package/dist/declarations/src/internal/content/version.d.ts +10 -1
- package/dist/declarations/src/internal/elementPicker.d.ts +8 -0
- package/dist/declarations/src/internal/index.d.ts +1 -0
- package/dist/declarations/src/internal/sketchpad/sketchFormat.d.ts +1 -16
- package/dist/declarations/src/internal/valCanvasProtocol.d.ts +34 -13
- package/dist/declarations/src/publish/builder.d.ts +7 -2
- package/dist/{getSitemapTree-dc61b8b6.cjs.dev.js → getSitemapTree-09399379.cjs.dev.js} +36 -6
- package/dist/{getSitemapTree-2b22cf1b.esm.js → getSitemapTree-6d875612.esm.js} +34 -7
- package/dist/{getSitemapTree-d0942fca.cjs.prod.js → getSitemapTree-7ed70b4a.cjs.prod.js} +36 -6
- package/internal/dist/valbuild-shared-internal.cjs.dev.js +145 -217
- package/internal/dist/valbuild-shared-internal.cjs.prod.js +145 -217
- package/internal/dist/valbuild-shared-internal.esm.js +140 -217
- package/package.json +3 -3
|
@@ -250,7 +250,7 @@ function isValCanvasPageMessage(data) {
|
|
|
250
250
|
if (createForOfIteratorHelper._typeof(data) !== "object" || data === null) return false;
|
|
251
251
|
var message = data;
|
|
252
252
|
if (message.val !== VAL_CANVAS_MESSAGE) return false;
|
|
253
|
-
return message.type === "ready" && isModulePathList(data.holds) && isHeldVersions(data.holdsVersions) || message.type === "elements" || message.type === "clicked" || message.type === "pinch" || message.type === "zoom" || message.type === "refreshing" || message.type === "elementPickingStopped" || message.type === "elementPicked" && isPickedElement(data.element) || message.type === "location" && isPageLocation(data) || message.type === "pageRead" && typeof data.requestId === "string" || message.type === "pageScreenshot" && typeof data.requestId === "string" || message.type === "quickPreviewStored" && typeof data.id === "string";
|
|
253
|
+
return message.type === "ready" && isModulePathList(data.holds) && isHeldVersions(data.holdsVersions) || message.type === "elements" || message.type === "clicked" || message.type === "pinch" || message.type === "zoom" || message.type === "refreshing" || message.type === "elementPickingStopped" || message.type === "pickingStopped" || message.type === "elementPicked" && isPickedElement(data.element) || message.type === "location" && isPageLocation(data) || message.type === "pageRead" && typeof data.requestId === "string" || message.type === "pageScreenshot" && typeof data.requestId === "string" || message.type === "quickPreviewStored" && typeof data.id === "string" || message.type === "codeChanged" && Array.isArray(data.modules) && isModulePathList(data.modules);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
/** `holdsVersions` on `ready`: absent, or a version per module path. */
|
|
@@ -313,7 +313,7 @@ function isValCanvasStudioMessage(data) {
|
|
|
313
313
|
}
|
|
314
314
|
if (message.type === "pickElements") {
|
|
315
315
|
var pick = data;
|
|
316
|
-
return typeof pick.enabled === "boolean" && typeof pick.active === "boolean" && typeof pick.keepPicked === "boolean" && PICK_MODIFIERS.includes(pick.modifier);
|
|
316
|
+
return typeof pick.enabled === "boolean" && typeof pick.active === "boolean" && typeof pick.keepPicked === "boolean" && PICK_MODIFIERS.includes(pick.modifier) && (pick.fieldsOnly === undefined || typeof pick.fieldsOnly === "boolean") && (pick.color === undefined || isCanvasSelectionColor(pick.color));
|
|
317
317
|
}
|
|
318
318
|
if (message.type === "scrollTo") {
|
|
319
319
|
var scroll = data;
|
|
@@ -373,6 +373,24 @@ function withValCanvasParam(url) {
|
|
|
373
373
|
return "".concat(url).concat(separator).concat(VAL_CANVAS_PARAM, "=1");
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
+
/**
|
|
377
|
+
* The `val-overlay-spa` event a page sends when what it renders and what the
|
|
378
|
+
* Studio relays have stopped agreeing about the code: these modules came
|
|
379
|
+
* made with another schema than this page's build has. The on-site overlay
|
|
380
|
+
* shows it with a reload; in the Studio's canvas the bridge passes it on
|
|
381
|
+
* (`codeChanged` in `valCanvasProtocol.ts`). An empty list takes it back.
|
|
382
|
+
*/
|
|
383
|
+
var CODE_CHANGED_EVENT = "codeChanged";
|
|
384
|
+
/** Whether a `val-overlay-spa` event's detail is a {@link CodeChangedDetail}. */
|
|
385
|
+
function isCodeChangedDetail(detail) {
|
|
386
|
+
if (createForOfIteratorHelper._typeof(detail) !== "object" || detail === null) return false;
|
|
387
|
+
if (!("type" in detail) || detail.type !== CODE_CHANGED_EVENT) return false;
|
|
388
|
+
if (!("modules" in detail) || !Array.isArray(detail.modules)) return false;
|
|
389
|
+
return detail.modules.every(function (module) {
|
|
390
|
+
return typeof module === "string" && module.startsWith("/");
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
|
|
376
394
|
/**
|
|
377
395
|
* Pointing at anything on a page, as Lovable's picker does: hover outlines
|
|
378
396
|
* the element under the pointer, a click picks it, and the assistant is told
|
|
@@ -471,8 +489,15 @@ function attachElementPicker(root, options) {
|
|
|
471
489
|
var picking = function picking(event) {
|
|
472
490
|
return options.active() || held(event, options.modifier);
|
|
473
491
|
};
|
|
492
|
+
var pickable = function pickable(element) {
|
|
493
|
+
var _options$fieldsOnly;
|
|
494
|
+
if (element === null || !root.contains(element)) return null;
|
|
495
|
+
if (((_options$fieldsOnly = options.fieldsOnly) === null || _options$fieldsOnly === void 0 ? void 0 : _options$fieldsOnly.call(options)) !== true) return element;
|
|
496
|
+
var field = element.closest("[data-val-path]");
|
|
497
|
+
return field !== null && root.contains(field) ? field : null;
|
|
498
|
+
};
|
|
474
499
|
var target = function target(event) {
|
|
475
|
-
return event.target instanceof Element
|
|
500
|
+
return pickable(event.target instanceof Element ? event.target : null);
|
|
476
501
|
};
|
|
477
502
|
var onMove = function onMove(event) {
|
|
478
503
|
last = {
|
|
@@ -533,8 +558,7 @@ function attachElementPicker(root, options) {
|
|
|
533
558
|
return;
|
|
534
559
|
}
|
|
535
560
|
if (last === null) return;
|
|
536
|
-
|
|
537
|
-
options.onHover(under !== null && root.contains(under) ? under : null);
|
|
561
|
+
options.onHover(pickable(root.ownerDocument.elementFromPoint(last.x, last.y)));
|
|
538
562
|
};
|
|
539
563
|
var onLeave = function onLeave() {
|
|
540
564
|
last = null;
|
|
@@ -636,7 +660,9 @@ function createPickerOverlay(doc, initialColor) {
|
|
|
636
660
|
left: "".concat(rect.left - 2, "px"),
|
|
637
661
|
width: "".concat(rect.width + 4, "px"),
|
|
638
662
|
height: "".concat(rect.height + 4, "px"),
|
|
639
|
-
|
|
663
|
+
// Dashed, both: it is what the assistant is pointed at, and the
|
|
664
|
+
// canvas's own field outlines -- Content's Select -- are solid.
|
|
665
|
+
border: "2px dashed ".concat(color)
|
|
640
666
|
});
|
|
641
667
|
if (kind === "hover") {
|
|
642
668
|
label.textContent = elementLabel(element);
|
|
@@ -707,6 +733,7 @@ function startElementPicking(root, options) {
|
|
|
707
733
|
var detach = attachElementPicker(root, {
|
|
708
734
|
modifier: options.modifier,
|
|
709
735
|
active: options.active,
|
|
736
|
+
fieldsOnly: options.fieldsOnly,
|
|
710
737
|
onHover: function onHover(element) {
|
|
711
738
|
return overlay.show("hover", element);
|
|
712
739
|
},
|
|
@@ -1455,6 +1482,7 @@ function getPatternFromModuleFilePath(moduleFilePath, srcFolder) {
|
|
|
1455
1482
|
.replace("/page.val.ts", "").replace("/page.val.js", "");
|
|
1456
1483
|
}
|
|
1457
1484
|
|
|
1485
|
+
exports.CODE_CHANGED_EVENT = CODE_CHANGED_EVENT;
|
|
1458
1486
|
exports.DEFAULT_CANVAS_SELECTION = DEFAULT_CANVAS_SELECTION;
|
|
1459
1487
|
exports.DEFAULT_CANVAS_SELECTION_SOFT = DEFAULT_CANVAS_SELECTION_SOFT;
|
|
1460
1488
|
exports.QUICK_PREVIEW_PARAM = QUICK_PREVIEW_PARAM;
|
|
@@ -1478,6 +1506,8 @@ exports.getPageRouterSitemapTree = getPageRouterSitemapTree;
|
|
|
1478
1506
|
exports.getPageRouterSourceFolder = getPageRouterSourceFolder;
|
|
1479
1507
|
exports.getPatternFromModuleFilePath = getPatternFromModuleFilePath;
|
|
1480
1508
|
exports.getTanStackRouterSourceFolder = getTanStackRouterSourceFolder;
|
|
1509
|
+
exports.isCanvasSelectionColor = isCanvasSelectionColor;
|
|
1510
|
+
exports.isCodeChangedDetail = isCodeChangedDetail;
|
|
1481
1511
|
exports.isQuickPreviewFiles = isQuickPreviewFiles;
|
|
1482
1512
|
exports.isTanStackRoutesFolder = isTanStackRoutesFolder;
|
|
1483
1513
|
exports.isValCanvasFrame = isValCanvasFrame;
|
|
@@ -230,7 +230,7 @@ function isValCanvasPageMessage(data) {
|
|
|
230
230
|
if (_typeof(data) !== "object" || data === null) return false;
|
|
231
231
|
var message = data;
|
|
232
232
|
if (message.val !== VAL_CANVAS_MESSAGE) return false;
|
|
233
|
-
return message.type === "ready" && isModulePathList(data.holds) && isHeldVersions(data.holdsVersions) || message.type === "elements" || message.type === "clicked" || message.type === "pinch" || message.type === "zoom" || message.type === "refreshing" || message.type === "elementPickingStopped" || message.type === "elementPicked" && isPickedElement(data.element) || message.type === "location" && isPageLocation(data) || message.type === "pageRead" && typeof data.requestId === "string" || message.type === "pageScreenshot" && typeof data.requestId === "string" || message.type === "quickPreviewStored" && typeof data.id === "string";
|
|
233
|
+
return message.type === "ready" && isModulePathList(data.holds) && isHeldVersions(data.holdsVersions) || message.type === "elements" || message.type === "clicked" || message.type === "pinch" || message.type === "zoom" || message.type === "refreshing" || message.type === "elementPickingStopped" || message.type === "pickingStopped" || message.type === "elementPicked" && isPickedElement(data.element) || message.type === "location" && isPageLocation(data) || message.type === "pageRead" && typeof data.requestId === "string" || message.type === "pageScreenshot" && typeof data.requestId === "string" || message.type === "quickPreviewStored" && typeof data.id === "string" || message.type === "codeChanged" && Array.isArray(data.modules) && isModulePathList(data.modules);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
/** `holdsVersions` on `ready`: absent, or a version per module path. */
|
|
@@ -293,7 +293,7 @@ function isValCanvasStudioMessage(data) {
|
|
|
293
293
|
}
|
|
294
294
|
if (message.type === "pickElements") {
|
|
295
295
|
var pick = data;
|
|
296
|
-
return typeof pick.enabled === "boolean" && typeof pick.active === "boolean" && typeof pick.keepPicked === "boolean" && PICK_MODIFIERS.includes(pick.modifier);
|
|
296
|
+
return typeof pick.enabled === "boolean" && typeof pick.active === "boolean" && typeof pick.keepPicked === "boolean" && PICK_MODIFIERS.includes(pick.modifier) && (pick.fieldsOnly === undefined || typeof pick.fieldsOnly === "boolean") && (pick.color === undefined || isCanvasSelectionColor(pick.color));
|
|
297
297
|
}
|
|
298
298
|
if (message.type === "scrollTo") {
|
|
299
299
|
var scroll = data;
|
|
@@ -353,6 +353,24 @@ function withValCanvasParam(url) {
|
|
|
353
353
|
return "".concat(url).concat(separator).concat(VAL_CANVAS_PARAM, "=1");
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
+
/**
|
|
357
|
+
* The `val-overlay-spa` event a page sends when what it renders and what the
|
|
358
|
+
* Studio relays have stopped agreeing about the code: these modules came
|
|
359
|
+
* made with another schema than this page's build has. The on-site overlay
|
|
360
|
+
* shows it with a reload; in the Studio's canvas the bridge passes it on
|
|
361
|
+
* (`codeChanged` in `valCanvasProtocol.ts`). An empty list takes it back.
|
|
362
|
+
*/
|
|
363
|
+
var CODE_CHANGED_EVENT = "codeChanged";
|
|
364
|
+
/** Whether a `val-overlay-spa` event's detail is a {@link CodeChangedDetail}. */
|
|
365
|
+
function isCodeChangedDetail(detail) {
|
|
366
|
+
if (_typeof(detail) !== "object" || detail === null) return false;
|
|
367
|
+
if (!("type" in detail) || detail.type !== CODE_CHANGED_EVENT) return false;
|
|
368
|
+
if (!("modules" in detail) || !Array.isArray(detail.modules)) return false;
|
|
369
|
+
return detail.modules.every(function (module) {
|
|
370
|
+
return typeof module === "string" && module.startsWith("/");
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
|
|
356
374
|
/**
|
|
357
375
|
* Pointing at anything on a page, as Lovable's picker does: hover outlines
|
|
358
376
|
* the element under the pointer, a click picks it, and the assistant is told
|
|
@@ -451,8 +469,15 @@ function attachElementPicker(root, options) {
|
|
|
451
469
|
var picking = function picking(event) {
|
|
452
470
|
return options.active() || held(event, options.modifier);
|
|
453
471
|
};
|
|
472
|
+
var pickable = function pickable(element) {
|
|
473
|
+
var _options$fieldsOnly;
|
|
474
|
+
if (element === null || !root.contains(element)) return null;
|
|
475
|
+
if (((_options$fieldsOnly = options.fieldsOnly) === null || _options$fieldsOnly === void 0 ? void 0 : _options$fieldsOnly.call(options)) !== true) return element;
|
|
476
|
+
var field = element.closest("[data-val-path]");
|
|
477
|
+
return field !== null && root.contains(field) ? field : null;
|
|
478
|
+
};
|
|
454
479
|
var target = function target(event) {
|
|
455
|
-
return event.target instanceof Element
|
|
480
|
+
return pickable(event.target instanceof Element ? event.target : null);
|
|
456
481
|
};
|
|
457
482
|
var onMove = function onMove(event) {
|
|
458
483
|
last = {
|
|
@@ -513,8 +538,7 @@ function attachElementPicker(root, options) {
|
|
|
513
538
|
return;
|
|
514
539
|
}
|
|
515
540
|
if (last === null) return;
|
|
516
|
-
|
|
517
|
-
options.onHover(under !== null && root.contains(under) ? under : null);
|
|
541
|
+
options.onHover(pickable(root.ownerDocument.elementFromPoint(last.x, last.y)));
|
|
518
542
|
};
|
|
519
543
|
var onLeave = function onLeave() {
|
|
520
544
|
last = null;
|
|
@@ -616,7 +640,9 @@ function createPickerOverlay(doc, initialColor) {
|
|
|
616
640
|
left: "".concat(rect.left - 2, "px"),
|
|
617
641
|
width: "".concat(rect.width + 4, "px"),
|
|
618
642
|
height: "".concat(rect.height + 4, "px"),
|
|
619
|
-
|
|
643
|
+
// Dashed, both: it is what the assistant is pointed at, and the
|
|
644
|
+
// canvas's own field outlines -- Content's Select -- are solid.
|
|
645
|
+
border: "2px dashed ".concat(color)
|
|
620
646
|
});
|
|
621
647
|
if (kind === "hover") {
|
|
622
648
|
label.textContent = elementLabel(element);
|
|
@@ -687,6 +713,7 @@ function startElementPicking(root, options) {
|
|
|
687
713
|
var detach = attachElementPicker(root, {
|
|
688
714
|
modifier: options.modifier,
|
|
689
715
|
active: options.active,
|
|
716
|
+
fieldsOnly: options.fieldsOnly,
|
|
690
717
|
onHover: function onHover(element) {
|
|
691
718
|
return overlay.show("hover", element);
|
|
692
719
|
},
|
|
@@ -1435,4 +1462,4 @@ function getPatternFromModuleFilePath(moduleFilePath, srcFolder) {
|
|
|
1435
1462
|
.replace("/page.val.ts", "").replace("/page.val.js", "");
|
|
1436
1463
|
}
|
|
1437
1464
|
|
|
1438
|
-
export {
|
|
1465
|
+
export { isQuickPreviewFiles as A, QUICK_PREVIEW_SERVICE_WORKER_SOURCE as B, CODE_CHANGED_EVENT as C, DEFAULT_CANVAS_SELECTION as D, storeQuickPreview as E, withQuickPreviewParam as F, parseRoutePattern as G, formatRoutePattern as H, getNextAppRouterSourceFolder as I, getTanStackRouterSourceFolder as J, getPageRouterSourceFolder as K, isTanStackRoutesFolder as L, getPageRouterSitemapTree as M, getPatternFromModuleFilePath as N, QUICK_PREVIEW_PARAM as Q, VAL_CONFIG_SESSION_STORAGE_KEY as V, VAL_THEME_SESSION_STORAGE_KEY as a, VAL_AI_SESSION_STORAGE_KEY as b, VAL_CANVAS_PARAM as c, VAL_CANVAS_MESSAGE as d, DEFAULT_CANVAS_SELECTION_SOFT as e, isCanvasSelectionColor as f, isValCanvasStudioMessage as g, isValCanvasFrame as h, isValCanvasPageMessage as i, isCodeChangedDetail as j, describeElement as k, attachElementPicker as l, modifierLabel as m, createPickerOverlay as n, elementLabel as o, pageLocationOf as p, watchPageLocation as q, restoreScroll as r, startElementPicking as s, readPageSnapshot as t, findBySelector as u, screenshotPage as v, withValCanvasParam as w, QUICK_PREVIEW_SERVICE_WORKER_PATH as x, QUICK_PREVIEW_RENDER_SCRIPT as y, QUICK_PREVIEW_STORE_MESSAGE as z };
|
|
@@ -250,7 +250,7 @@ function isValCanvasPageMessage(data) {
|
|
|
250
250
|
if (createForOfIteratorHelper._typeof(data) !== "object" || data === null) return false;
|
|
251
251
|
var message = data;
|
|
252
252
|
if (message.val !== VAL_CANVAS_MESSAGE) return false;
|
|
253
|
-
return message.type === "ready" && isModulePathList(data.holds) && isHeldVersions(data.holdsVersions) || message.type === "elements" || message.type === "clicked" || message.type === "pinch" || message.type === "zoom" || message.type === "refreshing" || message.type === "elementPickingStopped" || message.type === "elementPicked" && isPickedElement(data.element) || message.type === "location" && isPageLocation(data) || message.type === "pageRead" && typeof data.requestId === "string" || message.type === "pageScreenshot" && typeof data.requestId === "string" || message.type === "quickPreviewStored" && typeof data.id === "string";
|
|
253
|
+
return message.type === "ready" && isModulePathList(data.holds) && isHeldVersions(data.holdsVersions) || message.type === "elements" || message.type === "clicked" || message.type === "pinch" || message.type === "zoom" || message.type === "refreshing" || message.type === "elementPickingStopped" || message.type === "pickingStopped" || message.type === "elementPicked" && isPickedElement(data.element) || message.type === "location" && isPageLocation(data) || message.type === "pageRead" && typeof data.requestId === "string" || message.type === "pageScreenshot" && typeof data.requestId === "string" || message.type === "quickPreviewStored" && typeof data.id === "string" || message.type === "codeChanged" && Array.isArray(data.modules) && isModulePathList(data.modules);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
/** `holdsVersions` on `ready`: absent, or a version per module path. */
|
|
@@ -313,7 +313,7 @@ function isValCanvasStudioMessage(data) {
|
|
|
313
313
|
}
|
|
314
314
|
if (message.type === "pickElements") {
|
|
315
315
|
var pick = data;
|
|
316
|
-
return typeof pick.enabled === "boolean" && typeof pick.active === "boolean" && typeof pick.keepPicked === "boolean" && PICK_MODIFIERS.includes(pick.modifier);
|
|
316
|
+
return typeof pick.enabled === "boolean" && typeof pick.active === "boolean" && typeof pick.keepPicked === "boolean" && PICK_MODIFIERS.includes(pick.modifier) && (pick.fieldsOnly === undefined || typeof pick.fieldsOnly === "boolean") && (pick.color === undefined || isCanvasSelectionColor(pick.color));
|
|
317
317
|
}
|
|
318
318
|
if (message.type === "scrollTo") {
|
|
319
319
|
var scroll = data;
|
|
@@ -373,6 +373,24 @@ function withValCanvasParam(url) {
|
|
|
373
373
|
return "".concat(url).concat(separator).concat(VAL_CANVAS_PARAM, "=1");
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
+
/**
|
|
377
|
+
* The `val-overlay-spa` event a page sends when what it renders and what the
|
|
378
|
+
* Studio relays have stopped agreeing about the code: these modules came
|
|
379
|
+
* made with another schema than this page's build has. The on-site overlay
|
|
380
|
+
* shows it with a reload; in the Studio's canvas the bridge passes it on
|
|
381
|
+
* (`codeChanged` in `valCanvasProtocol.ts`). An empty list takes it back.
|
|
382
|
+
*/
|
|
383
|
+
var CODE_CHANGED_EVENT = "codeChanged";
|
|
384
|
+
/** Whether a `val-overlay-spa` event's detail is a {@link CodeChangedDetail}. */
|
|
385
|
+
function isCodeChangedDetail(detail) {
|
|
386
|
+
if (createForOfIteratorHelper._typeof(detail) !== "object" || detail === null) return false;
|
|
387
|
+
if (!("type" in detail) || detail.type !== CODE_CHANGED_EVENT) return false;
|
|
388
|
+
if (!("modules" in detail) || !Array.isArray(detail.modules)) return false;
|
|
389
|
+
return detail.modules.every(function (module) {
|
|
390
|
+
return typeof module === "string" && module.startsWith("/");
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
|
|
376
394
|
/**
|
|
377
395
|
* Pointing at anything on a page, as Lovable's picker does: hover outlines
|
|
378
396
|
* the element under the pointer, a click picks it, and the assistant is told
|
|
@@ -471,8 +489,15 @@ function attachElementPicker(root, options) {
|
|
|
471
489
|
var picking = function picking(event) {
|
|
472
490
|
return options.active() || held(event, options.modifier);
|
|
473
491
|
};
|
|
492
|
+
var pickable = function pickable(element) {
|
|
493
|
+
var _options$fieldsOnly;
|
|
494
|
+
if (element === null || !root.contains(element)) return null;
|
|
495
|
+
if (((_options$fieldsOnly = options.fieldsOnly) === null || _options$fieldsOnly === void 0 ? void 0 : _options$fieldsOnly.call(options)) !== true) return element;
|
|
496
|
+
var field = element.closest("[data-val-path]");
|
|
497
|
+
return field !== null && root.contains(field) ? field : null;
|
|
498
|
+
};
|
|
474
499
|
var target = function target(event) {
|
|
475
|
-
return event.target instanceof Element
|
|
500
|
+
return pickable(event.target instanceof Element ? event.target : null);
|
|
476
501
|
};
|
|
477
502
|
var onMove = function onMove(event) {
|
|
478
503
|
last = {
|
|
@@ -533,8 +558,7 @@ function attachElementPicker(root, options) {
|
|
|
533
558
|
return;
|
|
534
559
|
}
|
|
535
560
|
if (last === null) return;
|
|
536
|
-
|
|
537
|
-
options.onHover(under !== null && root.contains(under) ? under : null);
|
|
561
|
+
options.onHover(pickable(root.ownerDocument.elementFromPoint(last.x, last.y)));
|
|
538
562
|
};
|
|
539
563
|
var onLeave = function onLeave() {
|
|
540
564
|
last = null;
|
|
@@ -636,7 +660,9 @@ function createPickerOverlay(doc, initialColor) {
|
|
|
636
660
|
left: "".concat(rect.left - 2, "px"),
|
|
637
661
|
width: "".concat(rect.width + 4, "px"),
|
|
638
662
|
height: "".concat(rect.height + 4, "px"),
|
|
639
|
-
|
|
663
|
+
// Dashed, both: it is what the assistant is pointed at, and the
|
|
664
|
+
// canvas's own field outlines -- Content's Select -- are solid.
|
|
665
|
+
border: "2px dashed ".concat(color)
|
|
640
666
|
});
|
|
641
667
|
if (kind === "hover") {
|
|
642
668
|
label.textContent = elementLabel(element);
|
|
@@ -707,6 +733,7 @@ function startElementPicking(root, options) {
|
|
|
707
733
|
var detach = attachElementPicker(root, {
|
|
708
734
|
modifier: options.modifier,
|
|
709
735
|
active: options.active,
|
|
736
|
+
fieldsOnly: options.fieldsOnly,
|
|
710
737
|
onHover: function onHover(element) {
|
|
711
738
|
return overlay.show("hover", element);
|
|
712
739
|
},
|
|
@@ -1455,6 +1482,7 @@ function getPatternFromModuleFilePath(moduleFilePath, srcFolder) {
|
|
|
1455
1482
|
.replace("/page.val.ts", "").replace("/page.val.js", "");
|
|
1456
1483
|
}
|
|
1457
1484
|
|
|
1485
|
+
exports.CODE_CHANGED_EVENT = CODE_CHANGED_EVENT;
|
|
1458
1486
|
exports.DEFAULT_CANVAS_SELECTION = DEFAULT_CANVAS_SELECTION;
|
|
1459
1487
|
exports.DEFAULT_CANVAS_SELECTION_SOFT = DEFAULT_CANVAS_SELECTION_SOFT;
|
|
1460
1488
|
exports.QUICK_PREVIEW_PARAM = QUICK_PREVIEW_PARAM;
|
|
@@ -1478,6 +1506,8 @@ exports.getPageRouterSitemapTree = getPageRouterSitemapTree;
|
|
|
1478
1506
|
exports.getPageRouterSourceFolder = getPageRouterSourceFolder;
|
|
1479
1507
|
exports.getPatternFromModuleFilePath = getPatternFromModuleFilePath;
|
|
1480
1508
|
exports.getTanStackRouterSourceFolder = getTanStackRouterSourceFolder;
|
|
1509
|
+
exports.isCanvasSelectionColor = isCanvasSelectionColor;
|
|
1510
|
+
exports.isCodeChangedDetail = isCodeChangedDetail;
|
|
1481
1511
|
exports.isQuickPreviewFiles = isQuickPreviewFiles;
|
|
1482
1512
|
exports.isTanStackRoutesFolder = isTanStackRoutesFolder;
|
|
1483
1513
|
exports.isValCanvasFrame = isValCanvasFrame;
|