@valbuild/shared 0.150.2 → 0.150.8
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 +31 -0
- package/client/dist/valbuild-shared-client.cjs.dev.js +8 -2
- package/client/dist/valbuild-shared-client.cjs.prod.js +8 -2
- package/client/dist/valbuild-shared-client.esm.js +2 -2
- package/dist/{acquireTypes-50960f2c.esm.js → acquireTypes-6e2f7961.esm.js} +2 -2
- package/dist/{acquireTypes-de10005d.cjs.dev.js → acquireTypes-84a4077a.cjs.dev.js} +6 -6
- package/dist/{acquireTypes-e9467a2a.cjs.prod.js → acquireTypes-dd976839.cjs.prod.js} +6 -6
- package/dist/{createForOfIteratorHelper-3db5d737.esm.js → createForOfIteratorHelper-666a6d17.esm.js} +31 -15
- package/dist/{createForOfIteratorHelper-90e6a8b6.cjs.prod.js → createForOfIteratorHelper-87a33eff.cjs.dev.js} +31 -15
- package/dist/{createForOfIteratorHelper-d86bb352.cjs.dev.js → createForOfIteratorHelper-fef4fa7d.cjs.prod.js} +31 -15
- package/dist/declarations/src/client/index.d.ts +1 -0
- package/dist/declarations/src/internal/ApiRoutes.d.ts +8 -0
- package/dist/declarations/src/internal/elementPicker.d.ts +96 -0
- package/dist/declarations/src/internal/index.d.ts +1 -0
- package/dist/declarations/src/internal/theme/accentRamp.d.ts +20 -0
- package/dist/declarations/src/internal/valCanvasProtocol.d.ts +36 -0
- package/dist/{getSitemapTree-667bcb3c.cjs.prod.js → getSitemapTree-873f7266.cjs.prod.js} +333 -2
- package/dist/{getSitemapTree-5afbc3ac.esm.js → getSitemapTree-b6161fd8.esm.js} +328 -3
- package/dist/{getSitemapTree-0fa0569c.cjs.dev.js → getSitemapTree-be70d9fc.cjs.dev.js} +333 -2
- package/dist/{proposalProject-a3d3ad76.esm.js → proposalProject-689c24cc.esm.js} +2 -2
- package/dist/{proposalProject-cdc53711.cjs.dev.js → proposalProject-926f2c68.cjs.dev.js} +2 -2
- package/dist/{proposalProject-28550146.cjs.prod.js → proposalProject-fab0c026.cjs.prod.js} +2 -2
- package/dist/{protocol-1c13de0d.cjs.prod.js → protocol-4e2a455b.cjs.prod.js} +1 -1
- package/dist/{protocol-3b9ef786.esm.js → protocol-7ddc1a71.esm.js} +1 -1
- package/dist/{protocol-d8a6efda.cjs.dev.js → protocol-ac1c3ec7.cjs.dev.js} +1 -1
- package/dist/{slicedToArray-6cd80315.esm.js → slicedToArray-22567815.esm.js} +2 -18
- package/dist/{slicedToArray-62e428df.cjs.dev.js → slicedToArray-c8a29f6b.cjs.dev.js} +1 -18
- package/dist/{slicedToArray-af50e684.cjs.prod.js → slicedToArray-d99b4e2e.cjs.prod.js} +1 -18
- package/internal/dist/valbuild-shared-internal.cjs.dev.js +71 -10
- package/internal/dist/valbuild-shared-internal.cjs.prod.js +71 -10
- package/internal/dist/valbuild-shared-internal.esm.js +63 -9
- package/package.json +2 -2
- package/publish/dist/valbuild-shared-publish.cjs.dev.js +6 -6
- package/publish/dist/valbuild-shared-publish.cjs.prod.js +6 -6
- package/publish/dist/valbuild-shared-publish.esm.js +4 -4
- package/typecheck/dist/valbuild-shared-typecheck.cjs.dev.js +7 -7
- package/typecheck/dist/valbuild-shared-typecheck.cjs.prod.js +7 -7
- package/typecheck/dist/valbuild-shared-typecheck.esm.js +5 -5
- package/typecheck/testing/dist/valbuild-shared-typecheck-testing.cjs.dev.js +4 -4
- package/typecheck/testing/dist/valbuild-shared-typecheck-testing.cjs.prod.js +4 -4
- package/typecheck/testing/dist/valbuild-shared-typecheck-testing.esm.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @valbuild/shared
|
|
2
2
|
|
|
3
|
+
## 0.150.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#960](https://github.com/valbuild/val/pull/960) [`5960071`](https://github.com/valbuild/val/commit/59600711af792f489b050ab47bcdc103d7d8c028) Thanks [@freekh](https://github.com/freekh)! - The design tab can point the assistant at anything on the page. Hold ⌥ (Alt) and click any element in the preview, or press **Select** first: the element under the pointer is outlined and named, and the one picked is shown above the assistant and sent with the next message. A **Pages** menu shows any of the site's pages in the preview, and **Publish** publishes the proposal from the tab, the same way its own Studio does. The checks are now a single quiet status beside the proposal's name, the history is behind a button, and the changed files are listed in the Changes view instead of a panel of their own.
|
|
8
|
+
|
|
9
|
+
The picking runs in the proposal's own page, through the canvas bridge in `@valbuild/next` and `@valbuild/tanstack`, so a site needs those packages at this version for picking to work in its design tab.
|
|
10
|
+
|
|
11
|
+
- [#963](https://github.com/valbuild/val/pull/963) [`f7d56ec`](https://github.com/valbuild/val/commit/f7d56ecaed8567c0ea2889bbf1ba64844356cb1a) Thanks [@freekh](https://github.com/freekh)! - The assistant's chats in a proposal are shared with everyone on the project. A chat started while you are in a proposal belongs to it: anyone on the project who opens the proposal sees it in the chat list, with who is in it, and can read it and keep asking. Messages are named once more than one person has written, and the chat header has a link to the chat. One question runs at a time: if someone else's question is running, what you write is sent when its answer is done. Chats started on the site stay your own.
|
|
12
|
+
|
|
13
|
+
It needs the content server that knows about proposal chats; with an older one, chats work as before.
|
|
14
|
+
|
|
15
|
+
## 0.150.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#954](https://github.com/valbuild/val/pull/954) [`bc0cc43`](https://github.com/valbuild/val/commit/bc0cc433e157cca08f9ee384a4fb8be9bd3dad2c) Thanks [@freekh](https://github.com/freekh)! - Proposals in the Studio, reworked:
|
|
20
|
+
|
|
21
|
+
- **Save becomes Publish.** In a proposal, one split button stands where Publish is on the site. Its main half is the next step (Save, then Build, then Publish), and its caret offers every step, so you can publish straight away: Publish saves first. The separate Publish button beside the switcher is gone.
|
|
22
|
+
- **The switcher is where the proposal is managed**, as on a phone: its name and changes, Compare with the site, Rename, Copy link and Close, then where else to go.
|
|
23
|
+
- **Upgrade proposals** have one Publish (the bar's), say what they upgrade in the Publish dialog, cannot be published while Val Build is still working them out, are discarded rather than closed, and have their own icon.
|
|
24
|
+
- **A published proposal** shows a dialog with the ways out (the site, a new proposal, all proposals), since nothing more can be done in it.
|
|
25
|
+
- **Notices about where you are** (an upgrade, an upgrade under way, a restore) pop up from the bottom right and stay until dismissed; a dismissed one folds into the status bar and comes back from there.
|
|
26
|
+
- **No more flash of the site's chrome** at a proposal's address: the bar says "Loading…" until it knows, a return visit starts in the proposal at once, and opening a proposal says "Opening …" while the browser gets there.
|
|
27
|
+
- **After a save**, "Updating the preview…" and a failed render check are shown beside the switcher, and the status bar counts what is not saved to the proposal instead of saying "All changes saved".
|
|
28
|
+
- **Dialogs** dim the Studio instead of hiding it.
|
|
29
|
+
- **`theme.proposal`** in `s.settings()` sets the colour the Studio wears in a proposal (Val's violet when unset), under Settings → Studio. Like the accent, its shades are generated so text on them stays legible.
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`bc0cc43`](https://github.com/valbuild/val/commit/bc0cc433e157cca08f9ee384a4fb8be9bd3dad2c)]:
|
|
32
|
+
- @valbuild/core@0.150.3
|
|
33
|
+
|
|
3
34
|
## 0.150.2
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var getSitemapTree = require('../../dist/getSitemapTree-
|
|
6
|
-
require('../../dist/createForOfIteratorHelper-
|
|
5
|
+
var getSitemapTree = require('../../dist/getSitemapTree-be70d9fc.cjs.dev.js');
|
|
6
|
+
require('../../dist/createForOfIteratorHelper-87a33eff.cjs.dev.js');
|
|
7
7
|
require('@valbuild/core');
|
|
8
8
|
|
|
9
9
|
|
|
@@ -15,6 +15,10 @@ exports.VAL_CANVAS_MESSAGE = getSitemapTree.VAL_CANVAS_MESSAGE;
|
|
|
15
15
|
exports.VAL_CANVAS_PARAM = getSitemapTree.VAL_CANVAS_PARAM;
|
|
16
16
|
exports.VAL_CONFIG_SESSION_STORAGE_KEY = getSitemapTree.VAL_CONFIG_SESSION_STORAGE_KEY;
|
|
17
17
|
exports.VAL_THEME_SESSION_STORAGE_KEY = getSitemapTree.VAL_THEME_SESSION_STORAGE_KEY;
|
|
18
|
+
exports.attachElementPicker = getSitemapTree.attachElementPicker;
|
|
19
|
+
exports.createPickerOverlay = getSitemapTree.createPickerOverlay;
|
|
20
|
+
exports.describeElement = getSitemapTree.describeElement;
|
|
21
|
+
exports.elementLabel = getSitemapTree.elementLabel;
|
|
18
22
|
exports.formatRoutePattern = getSitemapTree.formatRoutePattern;
|
|
19
23
|
exports.getNextAppRouterSourceFolder = getSitemapTree.getNextAppRouterSourceFolder;
|
|
20
24
|
exports.getPageRouterSitemapTree = getSitemapTree.getPageRouterSitemapTree;
|
|
@@ -25,5 +29,7 @@ exports.isTanStackRoutesFolder = getSitemapTree.isTanStackRoutesFolder;
|
|
|
25
29
|
exports.isValCanvasFrame = getSitemapTree.isValCanvasFrame;
|
|
26
30
|
exports.isValCanvasPageMessage = getSitemapTree.isValCanvasPageMessage;
|
|
27
31
|
exports.isValCanvasStudioMessage = getSitemapTree.isValCanvasStudioMessage;
|
|
32
|
+
exports.modifierLabel = getSitemapTree.modifierLabel;
|
|
28
33
|
exports.parseRoutePattern = getSitemapTree.parseRoutePattern;
|
|
34
|
+
exports.startElementPicking = getSitemapTree.startElementPicking;
|
|
29
35
|
exports.withValCanvasParam = getSitemapTree.withValCanvasParam;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var getSitemapTree = require('../../dist/getSitemapTree-
|
|
6
|
-
require('../../dist/createForOfIteratorHelper-
|
|
5
|
+
var getSitemapTree = require('../../dist/getSitemapTree-873f7266.cjs.prod.js');
|
|
6
|
+
require('../../dist/createForOfIteratorHelper-fef4fa7d.cjs.prod.js');
|
|
7
7
|
require('@valbuild/core');
|
|
8
8
|
|
|
9
9
|
|
|
@@ -15,6 +15,10 @@ exports.VAL_CANVAS_MESSAGE = getSitemapTree.VAL_CANVAS_MESSAGE;
|
|
|
15
15
|
exports.VAL_CANVAS_PARAM = getSitemapTree.VAL_CANVAS_PARAM;
|
|
16
16
|
exports.VAL_CONFIG_SESSION_STORAGE_KEY = getSitemapTree.VAL_CONFIG_SESSION_STORAGE_KEY;
|
|
17
17
|
exports.VAL_THEME_SESSION_STORAGE_KEY = getSitemapTree.VAL_THEME_SESSION_STORAGE_KEY;
|
|
18
|
+
exports.attachElementPicker = getSitemapTree.attachElementPicker;
|
|
19
|
+
exports.createPickerOverlay = getSitemapTree.createPickerOverlay;
|
|
20
|
+
exports.describeElement = getSitemapTree.describeElement;
|
|
21
|
+
exports.elementLabel = getSitemapTree.elementLabel;
|
|
18
22
|
exports.formatRoutePattern = getSitemapTree.formatRoutePattern;
|
|
19
23
|
exports.getNextAppRouterSourceFolder = getSitemapTree.getNextAppRouterSourceFolder;
|
|
20
24
|
exports.getPageRouterSitemapTree = getSitemapTree.getPageRouterSitemapTree;
|
|
@@ -25,5 +29,7 @@ exports.isTanStackRoutesFolder = getSitemapTree.isTanStackRoutesFolder;
|
|
|
25
29
|
exports.isValCanvasFrame = getSitemapTree.isValCanvasFrame;
|
|
26
30
|
exports.isValCanvasPageMessage = getSitemapTree.isValCanvasPageMessage;
|
|
27
31
|
exports.isValCanvasStudioMessage = getSitemapTree.isValCanvasStudioMessage;
|
|
32
|
+
exports.modifierLabel = getSitemapTree.modifierLabel;
|
|
28
33
|
exports.parseRoutePattern = getSitemapTree.parseRoutePattern;
|
|
34
|
+
exports.startElementPicking = getSitemapTree.startElementPicking;
|
|
29
35
|
exports.withValCanvasParam = getSitemapTree.withValCanvasParam;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { D as DEFAULT_CANVAS_SELECTION, e as DEFAULT_CANVAS_SELECTION_SOFT, b as VAL_AI_SESSION_STORAGE_KEY, d as VAL_CANVAS_MESSAGE, c as VAL_CANVAS_PARAM, V as VAL_CONFIG_SESSION_STORAGE_KEY, a as VAL_THEME_SESSION_STORAGE_KEY, h as formatRoutePattern,
|
|
2
|
-
import '../../dist/createForOfIteratorHelper-
|
|
1
|
+
export { D as DEFAULT_CANVAS_SELECTION, e as DEFAULT_CANVAS_SELECTION_SOFT, b as VAL_AI_SESSION_STORAGE_KEY, d as VAL_CANVAS_MESSAGE, c as VAL_CANVAS_PARAM, V as VAL_CONFIG_SESSION_STORAGE_KEY, a as VAL_THEME_SESSION_STORAGE_KEY, j as attachElementPicker, k as createPickerOverlay, h as describeElement, l as elementLabel, n as formatRoutePattern, o as getNextAppRouterSourceFolder, u as getPageRouterSitemapTree, r as getPageRouterSourceFolder, v as getPatternFromModuleFilePath, q as getTanStackRouterSourceFolder, t as isTanStackRoutesFolder, g as isValCanvasFrame, i as isValCanvasPageMessage, f as isValCanvasStudioMessage, m as modifierLabel, p as parseRoutePattern, s as startElementPicking, w as withValCanvasParam } from '../../dist/getSitemapTree-b6161fd8.esm.js';
|
|
2
|
+
import '../../dist/createForOfIteratorHelper-666a6d17.esm.js';
|
|
3
3
|
import '@valbuild/core';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _inherits, a as _createClass, c as _wrapNativeSuper, g as _slicedToArray, e as _classCallCheck, f as _callSuper,
|
|
2
|
-
import { _ as _typeof,
|
|
1
|
+
import { _ as _inherits, a as _createClass, c as _wrapNativeSuper, g as _slicedToArray, e as _classCallCheck, f as _callSuper, b as _asyncToGenerator, d as _regenerator } from './slicedToArray-22567815.esm.js';
|
|
2
|
+
import { _ as _typeof, c as _createForOfIteratorHelper, b as _toConsumableArray, d as _defineProperty, a as _objectSpread2 } from './createForOfIteratorHelper-666a6d17.esm.js';
|
|
3
3
|
import { parseAllDocuments } from 'yaml';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var slicedToArray = require('./slicedToArray-
|
|
4
|
-
var createForOfIteratorHelper = require('./createForOfIteratorHelper-
|
|
3
|
+
var slicedToArray = require('./slicedToArray-c8a29f6b.cjs.dev.js');
|
|
4
|
+
var createForOfIteratorHelper = require('./createForOfIteratorHelper-87a33eff.cjs.dev.js');
|
|
5
5
|
var yaml = require('yaml');
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -911,7 +911,7 @@ function hoist(lockfile, graph, skipped, kindOf, workspacePackages) {
|
|
|
911
911
|
entries.sort(function (a, b) {
|
|
912
912
|
return a.depth - b.depth || compareBytes(a.sortKey, b.sortKey);
|
|
913
913
|
});
|
|
914
|
-
var claimed = new Set(
|
|
914
|
+
var claimed = new Set(createForOfIteratorHelper._toConsumableArray((_direct$get$keys = (_direct$get = direct.get(".")) === null || _direct$get === void 0 ? void 0 : _direct$get.keys()) !== null && _direct$get$keys !== void 0 ? _direct$get$keys : []).map(function (alias) {
|
|
915
915
|
return alias.toLowerCase();
|
|
916
916
|
}));
|
|
917
917
|
var hoisted = new Map();
|
|
@@ -923,7 +923,7 @@ function hoist(lockfile, graph, skipped, kindOf, workspacePackages) {
|
|
|
923
923
|
var workspaceDone = false;
|
|
924
924
|
var hoistWorkspace = function hoistWorkspace() {
|
|
925
925
|
workspaceDone = true;
|
|
926
|
-
var candidates =
|
|
926
|
+
var candidates = createForOfIteratorHelper._toConsumableArray(workspacePackages).flatMap(function (_ref2) {
|
|
927
927
|
var _ref3 = slicedToArray._slicedToArray(_ref2, 2),
|
|
928
928
|
name = _ref3[0],
|
|
929
929
|
dir = _ref3[1];
|
|
@@ -1351,7 +1351,7 @@ var LinkedFileSystem = /*#__PURE__*/function () {
|
|
|
1351
1351
|
key: "getDirectories",
|
|
1352
1352
|
value: function getDirectories(path) {
|
|
1353
1353
|
var entries = this.directories.get(this.lookup(path));
|
|
1354
|
-
return entries ?
|
|
1354
|
+
return entries ? createForOfIteratorHelper._toConsumableArray(entries.directories).sort() : [];
|
|
1355
1355
|
}
|
|
1356
1356
|
|
|
1357
1357
|
/** The files in `path`. */
|
|
@@ -1359,7 +1359,7 @@ var LinkedFileSystem = /*#__PURE__*/function () {
|
|
|
1359
1359
|
key: "getFiles",
|
|
1360
1360
|
value: function getFiles(path) {
|
|
1361
1361
|
var entries = this.directories.get(this.lookup(path));
|
|
1362
|
-
return entries ?
|
|
1362
|
+
return entries ? createForOfIteratorHelper._toConsumableArray(entries.files).sort() : [];
|
|
1363
1363
|
}
|
|
1364
1364
|
|
|
1365
1365
|
/** Every file written, by real path. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var slicedToArray = require('./slicedToArray-
|
|
4
|
-
var createForOfIteratorHelper = require('./createForOfIteratorHelper-
|
|
3
|
+
var slicedToArray = require('./slicedToArray-d99b4e2e.cjs.prod.js');
|
|
4
|
+
var createForOfIteratorHelper = require('./createForOfIteratorHelper-fef4fa7d.cjs.prod.js');
|
|
5
5
|
var yaml = require('yaml');
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -911,7 +911,7 @@ function hoist(lockfile, graph, skipped, kindOf, workspacePackages) {
|
|
|
911
911
|
entries.sort(function (a, b) {
|
|
912
912
|
return a.depth - b.depth || compareBytes(a.sortKey, b.sortKey);
|
|
913
913
|
});
|
|
914
|
-
var claimed = new Set(
|
|
914
|
+
var claimed = new Set(createForOfIteratorHelper._toConsumableArray((_direct$get$keys = (_direct$get = direct.get(".")) === null || _direct$get === void 0 ? void 0 : _direct$get.keys()) !== null && _direct$get$keys !== void 0 ? _direct$get$keys : []).map(function (alias) {
|
|
915
915
|
return alias.toLowerCase();
|
|
916
916
|
}));
|
|
917
917
|
var hoisted = new Map();
|
|
@@ -923,7 +923,7 @@ function hoist(lockfile, graph, skipped, kindOf, workspacePackages) {
|
|
|
923
923
|
var workspaceDone = false;
|
|
924
924
|
var hoistWorkspace = function hoistWorkspace() {
|
|
925
925
|
workspaceDone = true;
|
|
926
|
-
var candidates =
|
|
926
|
+
var candidates = createForOfIteratorHelper._toConsumableArray(workspacePackages).flatMap(function (_ref2) {
|
|
927
927
|
var _ref3 = slicedToArray._slicedToArray(_ref2, 2),
|
|
928
928
|
name = _ref3[0],
|
|
929
929
|
dir = _ref3[1];
|
|
@@ -1351,7 +1351,7 @@ var LinkedFileSystem = /*#__PURE__*/function () {
|
|
|
1351
1351
|
key: "getDirectories",
|
|
1352
1352
|
value: function getDirectories(path) {
|
|
1353
1353
|
var entries = this.directories.get(this.lookup(path));
|
|
1354
|
-
return entries ?
|
|
1354
|
+
return entries ? createForOfIteratorHelper._toConsumableArray(entries.directories).sort() : [];
|
|
1355
1355
|
}
|
|
1356
1356
|
|
|
1357
1357
|
/** The files in `path`. */
|
|
@@ -1359,7 +1359,7 @@ var LinkedFileSystem = /*#__PURE__*/function () {
|
|
|
1359
1359
|
key: "getFiles",
|
|
1360
1360
|
value: function getFiles(path) {
|
|
1361
1361
|
var entries = this.directories.get(this.lookup(path));
|
|
1362
|
-
return entries ?
|
|
1362
|
+
return entries ? createForOfIteratorHelper._toConsumableArray(entries.files).sort() : [];
|
|
1363
1363
|
}
|
|
1364
1364
|
|
|
1365
1365
|
/** Every file written, by real path. */
|
package/dist/{createForOfIteratorHelper-3db5d737.esm.js → createForOfIteratorHelper-666a6d17.esm.js}
RENAMED
|
@@ -8,6 +8,36 @@ function _typeof(o) {
|
|
|
8
8
|
}, _typeof(o);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
function _arrayLikeToArray(r, a) {
|
|
12
|
+
(null == a || a > r.length) && (a = r.length);
|
|
13
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
14
|
+
return n;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function _arrayWithoutHoles(r) {
|
|
18
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function _iterableToArray(r) {
|
|
22
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function _unsupportedIterableToArray(r, a) {
|
|
26
|
+
if (r) {
|
|
27
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
28
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
29
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function _nonIterableSpread() {
|
|
34
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function _toConsumableArray(r) {
|
|
38
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
39
|
+
}
|
|
40
|
+
|
|
11
41
|
function _toPrimitive(t, r) {
|
|
12
42
|
if ("object" != typeof t || !t) return t;
|
|
13
43
|
var e = t[Symbol.toPrimitive];
|
|
@@ -55,20 +85,6 @@ function _objectSpread2(e) {
|
|
|
55
85
|
return e;
|
|
56
86
|
}
|
|
57
87
|
|
|
58
|
-
function _arrayLikeToArray(r, a) {
|
|
59
|
-
(null == a || a > r.length) && (a = r.length);
|
|
60
|
-
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
61
|
-
return n;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function _unsupportedIterableToArray(r, a) {
|
|
65
|
-
if (r) {
|
|
66
|
-
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
67
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
68
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
88
|
function _createForOfIteratorHelper(r, e) {
|
|
73
89
|
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
74
90
|
if (!t) {
|
|
@@ -118,4 +134,4 @@ function _createForOfIteratorHelper(r, e) {
|
|
|
118
134
|
};
|
|
119
135
|
}
|
|
120
136
|
|
|
121
|
-
export { _typeof as _,
|
|
137
|
+
export { _typeof as _, _objectSpread2 as a, _toConsumableArray as b, _createForOfIteratorHelper as c, _defineProperty as d, _toPropertyKey as e, _unsupportedIterableToArray as f };
|
|
@@ -10,6 +10,36 @@ function _typeof(o) {
|
|
|
10
10
|
}, _typeof(o);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
function _arrayLikeToArray(r, a) {
|
|
14
|
+
(null == a || a > r.length) && (a = r.length);
|
|
15
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
16
|
+
return n;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function _arrayWithoutHoles(r) {
|
|
20
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function _iterableToArray(r) {
|
|
24
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function _unsupportedIterableToArray(r, a) {
|
|
28
|
+
if (r) {
|
|
29
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
30
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
31
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function _nonIterableSpread() {
|
|
36
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function _toConsumableArray(r) {
|
|
40
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
41
|
+
}
|
|
42
|
+
|
|
13
43
|
function _toPrimitive(t, r) {
|
|
14
44
|
if ("object" != typeof t || !t) return t;
|
|
15
45
|
var e = t[Symbol.toPrimitive];
|
|
@@ -57,20 +87,6 @@ function _objectSpread2(e) {
|
|
|
57
87
|
return e;
|
|
58
88
|
}
|
|
59
89
|
|
|
60
|
-
function _arrayLikeToArray(r, a) {
|
|
61
|
-
(null == a || a > r.length) && (a = r.length);
|
|
62
|
-
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
63
|
-
return n;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function _unsupportedIterableToArray(r, a) {
|
|
67
|
-
if (r) {
|
|
68
|
-
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
69
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
70
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
90
|
function _createForOfIteratorHelper(r, e) {
|
|
75
91
|
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
76
92
|
if (!t) {
|
|
@@ -120,10 +136,10 @@ function _createForOfIteratorHelper(r, e) {
|
|
|
120
136
|
};
|
|
121
137
|
}
|
|
122
138
|
|
|
123
|
-
exports._arrayLikeToArray = _arrayLikeToArray;
|
|
124
139
|
exports._createForOfIteratorHelper = _createForOfIteratorHelper;
|
|
125
140
|
exports._defineProperty = _defineProperty;
|
|
126
141
|
exports._objectSpread2 = _objectSpread2;
|
|
142
|
+
exports._toConsumableArray = _toConsumableArray;
|
|
127
143
|
exports._toPropertyKey = _toPropertyKey;
|
|
128
144
|
exports._typeof = _typeof;
|
|
129
145
|
exports._unsupportedIterableToArray = _unsupportedIterableToArray;
|
|
@@ -10,6 +10,36 @@ function _typeof(o) {
|
|
|
10
10
|
}, _typeof(o);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
function _arrayLikeToArray(r, a) {
|
|
14
|
+
(null == a || a > r.length) && (a = r.length);
|
|
15
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
16
|
+
return n;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function _arrayWithoutHoles(r) {
|
|
20
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function _iterableToArray(r) {
|
|
24
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function _unsupportedIterableToArray(r, a) {
|
|
28
|
+
if (r) {
|
|
29
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
30
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
31
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function _nonIterableSpread() {
|
|
36
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function _toConsumableArray(r) {
|
|
40
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
41
|
+
}
|
|
42
|
+
|
|
13
43
|
function _toPrimitive(t, r) {
|
|
14
44
|
if ("object" != typeof t || !t) return t;
|
|
15
45
|
var e = t[Symbol.toPrimitive];
|
|
@@ -57,20 +87,6 @@ function _objectSpread2(e) {
|
|
|
57
87
|
return e;
|
|
58
88
|
}
|
|
59
89
|
|
|
60
|
-
function _arrayLikeToArray(r, a) {
|
|
61
|
-
(null == a || a > r.length) && (a = r.length);
|
|
62
|
-
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
63
|
-
return n;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function _unsupportedIterableToArray(r, a) {
|
|
67
|
-
if (r) {
|
|
68
|
-
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
69
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
70
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
90
|
function _createForOfIteratorHelper(r, e) {
|
|
75
91
|
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
76
92
|
if (!t) {
|
|
@@ -120,10 +136,10 @@ function _createForOfIteratorHelper(r, e) {
|
|
|
120
136
|
};
|
|
121
137
|
}
|
|
122
138
|
|
|
123
|
-
exports._arrayLikeToArray = _arrayLikeToArray;
|
|
124
139
|
exports._createForOfIteratorHelper = _createForOfIteratorHelper;
|
|
125
140
|
exports._defineProperty = _defineProperty;
|
|
126
141
|
exports._objectSpread2 = _objectSpread2;
|
|
142
|
+
exports._toConsumableArray = _toConsumableArray;
|
|
127
143
|
exports._toPropertyKey = _toPropertyKey;
|
|
128
144
|
exports._typeof = _typeof;
|
|
129
145
|
exports._unsupportedIterableToArray = _unsupportedIterableToArray;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export * from "../internal/sessionStorage.js";
|
|
18
18
|
export * from "../internal/valCanvasProtocol.js";
|
|
19
|
+
export * from "../internal/elementPicker.js";
|
|
19
20
|
export * from "../internal/parseRoutePattern.js";
|
|
20
21
|
export * from "../internal/getNextAppRouterSourceFolder.js";
|
|
21
22
|
export * from "../internal/getSitemapTree.js";
|
|
@@ -1988,6 +1988,12 @@ export declare const Api: {
|
|
|
1988
1988
|
limit: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>>>;
|
|
1989
1989
|
cursor_updatedAt: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>>>;
|
|
1990
1990
|
cursor_id: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>>>;
|
|
1991
|
+
/**
|
|
1992
|
+
* The proposal the Studio is in, by name: lists that proposal's
|
|
1993
|
+
* chats, everyone's, instead of your own (valbuild/home
|
|
1994
|
+
* `docs/proposals.md`, Flow H).
|
|
1995
|
+
*/
|
|
1996
|
+
proposal: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>>>;
|
|
1991
1997
|
};
|
|
1992
1998
|
cookies: {
|
|
1993
1999
|
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
@@ -2006,6 +2012,7 @@ export declare const Api: {
|
|
|
2006
2012
|
name: z.ZodNullable<z.ZodString>;
|
|
2007
2013
|
createdAt: z.ZodString;
|
|
2008
2014
|
updatedAt: z.ZodString;
|
|
2015
|
+
authorIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2009
2016
|
}, z.core.$strip>>;
|
|
2010
2017
|
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
2011
2018
|
updatedAt: z.ZodString;
|
|
@@ -2067,6 +2074,7 @@ export declare const Api: {
|
|
|
2067
2074
|
status: z.ZodLiteral<200>;
|
|
2068
2075
|
json: z.ZodObject<{
|
|
2069
2076
|
messages: z.ZodArray<z.ZodObject<{
|
|
2077
|
+
authorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2070
2078
|
role: z.ZodString;
|
|
2071
2079
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
2072
2080
|
type: z.ZodLiteral<"text">;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pointing at anything on a page, as Lovable's picker does: hover outlines
|
|
3
|
+
* the element under the pointer, a click picks it, and the assistant is told
|
|
4
|
+
* which (valbuild/home `docs/design-tab.md`).
|
|
5
|
+
*
|
|
6
|
+
* ANY element, not only what Val marks. The design tab changes code, and the
|
|
7
|
+
* thing a person wants changed is as often a wrapper, a gap or a button as a
|
|
8
|
+
* field -- so a field's path is extra information when there is one
|
|
9
|
+
* (`valPath`), never the condition for picking.
|
|
10
|
+
*
|
|
11
|
+
* Picking is on while a MODIFIER is held, so the page stays a page: links
|
|
12
|
+
* follow, menus open, and nothing has to be switched back off. `active`
|
|
13
|
+
* turns it on without one, for a Select button or a touch screen.
|
|
14
|
+
*
|
|
15
|
+
* Plain DOM, nothing of React's or the Studio's, and in `shared` because
|
|
16
|
+
* both halves need it: the canvas bridge (`@valbuild/next`,
|
|
17
|
+
* `@valbuild/tanstack`) runs it inside the proposal's page, which is another
|
|
18
|
+
* origin than the design tab and the only place the page's elements can be
|
|
19
|
+
* reached; the Studio's stories run it on a page of their own. Only the
|
|
20
|
+
* `PickedElement` crosses the frame (`valCanvasProtocol.ts`).
|
|
21
|
+
*/
|
|
22
|
+
export type PickedElement = {
|
|
23
|
+
/** `h2`, `section`, `button`… */
|
|
24
|
+
tag: string;
|
|
25
|
+
/** The words in it, shortened: what a person recognises it by. */
|
|
26
|
+
text: string;
|
|
27
|
+
/** Its own classes, as written. */
|
|
28
|
+
classes: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Where it is, from the root down, short enough to read:
|
|
31
|
+
* `section:nth-of-type(2) > h2`. An `id` ends the walk, since it is
|
|
32
|
+
* already unique.
|
|
33
|
+
*/
|
|
34
|
+
selector: string;
|
|
35
|
+
/** The Val field it shows, or is inside of; absent when it shows none. */
|
|
36
|
+
valPath?: string;
|
|
37
|
+
};
|
|
38
|
+
export type PickModifier = "alt" | "meta" | "shift" | "ctrl";
|
|
39
|
+
export declare function describeElement(element: Element, root: Element): PickedElement;
|
|
40
|
+
/** What a person is told to hold, on their own keyboard. */
|
|
41
|
+
export declare function modifierLabel(modifier: PickModifier, mac: boolean): string;
|
|
42
|
+
export type ElementPickerOptions = {
|
|
43
|
+
modifier: PickModifier;
|
|
44
|
+
/** On without the modifier: a Select button, or a touch screen. */
|
|
45
|
+
active: () => boolean;
|
|
46
|
+
/** The element under the pointer while picking; `null` when not picking. */
|
|
47
|
+
onHover: (element: Element | null) => void;
|
|
48
|
+
onPick: (element: Element) => void;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Listens on `root` (capturing, so the page's own handlers never see a pick)
|
|
52
|
+
* and returns what stops it.
|
|
53
|
+
*/
|
|
54
|
+
export declare function attachElementPicker(root: HTMLElement, options: ElementPickerOptions): () => void;
|
|
55
|
+
/**
|
|
56
|
+
* The outlines over the page while picking: the element under the pointer,
|
|
57
|
+
* named, and the one picked.
|
|
58
|
+
*
|
|
59
|
+
* Boxes `position: fixed` on top of everything, with `pointer-events: none`,
|
|
60
|
+
* appended to the page's body -- not outlines on the elements themselves.
|
|
61
|
+
* The canvas's field outlines are a stylesheet so they cannot disturb the
|
|
62
|
+
* page's layout (`ValCanvasBridge`); a fixed box is out of the flow, so it
|
|
63
|
+
* cannot either, and it is the one way to put a NAME beside any element, which
|
|
64
|
+
* a selector cannot reach.
|
|
65
|
+
*
|
|
66
|
+
* In a shadow root of one host element: the bridge re-measures the page on
|
|
67
|
+
* every `style` change under `body`, and a box that follows the pointer
|
|
68
|
+
* changes its style every frame. Inside a shadow root those changes are not
|
|
69
|
+
* the page's, so the host's one insertion is all the bridge sees.
|
|
70
|
+
*/
|
|
71
|
+
export type PickerOverlay = {
|
|
72
|
+
show: (kind: "hover" | "picked", element: Element | null) => void;
|
|
73
|
+
setColor: (color: string) => void;
|
|
74
|
+
destroy: () => void;
|
|
75
|
+
};
|
|
76
|
+
export declare function createPickerOverlay(doc: Document, initialColor: string): PickerOverlay;
|
|
77
|
+
/** `h2.mb-6.text-2xl`: what the hover box is named. */
|
|
78
|
+
export declare function elementLabel(element: Element): string;
|
|
79
|
+
export type ElementPicking = {
|
|
80
|
+
/** Take the picked outline down, when the Studio no longer holds the pick. */
|
|
81
|
+
clearPicked: () => void;
|
|
82
|
+
setColor: (color: string) => void;
|
|
83
|
+
stop: () => void;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Picking on a page, whole: the listeners, the outlines, and Esc to stop
|
|
87
|
+
* picking without the modifier. What a canvas bridge mounts.
|
|
88
|
+
*/
|
|
89
|
+
export declare function startElementPicking(root: HTMLElement, options: {
|
|
90
|
+
modifier: PickModifier;
|
|
91
|
+
active: () => boolean;
|
|
92
|
+
color: string;
|
|
93
|
+
onPick: (picked: PickedElement) => void;
|
|
94
|
+
/** Esc while `active`: the Studio turns Select off. */
|
|
95
|
+
onStop: () => void;
|
|
96
|
+
}): ElementPicking;
|
|
@@ -24,6 +24,7 @@ export * from "./localeAt.js";
|
|
|
24
24
|
export * from "./getErrorMessageFromUnknownJson.js";
|
|
25
25
|
export * from "./zod/SerializedSchema.js";
|
|
26
26
|
export * from "./valCanvasProtocol.js";
|
|
27
|
+
export * from "./elementPicker.js";
|
|
27
28
|
export * from "./emptyOf.js";
|
|
28
29
|
export * from "./aiTools/toolNames.js";
|
|
29
30
|
export * from "./aiTools/aiImageToolPatches.js";
|
|
@@ -71,7 +71,27 @@ export declare function themeCustomProperties(theme: {
|
|
|
71
71
|
accent?: string | null;
|
|
72
72
|
/** A `--radius` length. The caller maps the named step; see `THEME_RADIUS_LENGTHS`. */
|
|
73
73
|
radius?: string | null;
|
|
74
|
+
/** The proposal colour, a hex. See {@link proposalCustomProperties}. */
|
|
75
|
+
proposal?: string | null;
|
|
74
76
|
}): Record<string, string>;
|
|
77
|
+
/**
|
|
78
|
+
* The proposal colour's tokens, for light and dark at once.
|
|
79
|
+
*
|
|
80
|
+
* The six `--*-proposal` tokens are declared per mode in `index.css`, each as
|
|
81
|
+
* `var(--theme-proposal-<mode>-<token>, <Val's violet>)`, so the ones written
|
|
82
|
+
* here are picked up where the mode block is declared -- on every element the
|
|
83
|
+
* Studio stamps `data-mode` on, which is where these go (see
|
|
84
|
+
* `themeCustomProperties` on why a `var()` resolves where it is declared).
|
|
85
|
+
* Both modes' values are written because an element does not know which mode
|
|
86
|
+
* its subtree will be in by the time it is styled.
|
|
87
|
+
*
|
|
88
|
+
* From the same ramp as the accent: the hue is the project's, the lightness
|
|
89
|
+
* of each step Val's, so the steps chosen here have the contrast Val's violet
|
|
90
|
+
* had. Text on the filled colour is white unless white would not read, then
|
|
91
|
+
* the ramp's darkest step. Empty for a value that is not a usable hex, so
|
|
92
|
+
* Val's violet stays.
|
|
93
|
+
*/
|
|
94
|
+
export declare function proposalCustomProperties(hex: string): Record<string, string>;
|
|
75
95
|
/**
|
|
76
96
|
* WCAG relative luminance of a six-digit hex.
|
|
77
97
|
*
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* the frame's URL is scoped to exactly the one document that needs it.
|
|
21
21
|
*/
|
|
22
22
|
import type { ModuleFilePath, SourcePath } from "@valbuild/core";
|
|
23
|
+
import type { PickedElement, PickModifier } from "./elementPicker.js";
|
|
23
24
|
/** Marks a page load as the studio's canvas frame. */
|
|
24
25
|
export declare const VAL_CANVAS_PARAM = "val_canvas";
|
|
25
26
|
/**
|
|
@@ -170,6 +171,23 @@ export type ValCanvasPageMessage = {
|
|
|
170
171
|
* from outside, so the page says so and the canvas can show it is working.
|
|
171
172
|
*/
|
|
172
173
|
pending: boolean;
|
|
174
|
+
} | {
|
|
175
|
+
/**
|
|
176
|
+
* Something on the page was picked while `pickElements` was on: ANY
|
|
177
|
+
* element, described (`describeElement`), since the element itself
|
|
178
|
+
* cannot leave the page.
|
|
179
|
+
*/
|
|
180
|
+
val: typeof VAL_CANVAS_MESSAGE;
|
|
181
|
+
type: "elementPicked";
|
|
182
|
+
element: PickedElement;
|
|
183
|
+
} | {
|
|
184
|
+
/**
|
|
185
|
+
* Esc on the page while Select was on. The key went to the page, which
|
|
186
|
+
* has the focus once it has been clicked, so the studio hears it only
|
|
187
|
+
* from here.
|
|
188
|
+
*/
|
|
189
|
+
val: typeof VAL_CANVAS_MESSAGE;
|
|
190
|
+
type: "elementPickingStopped";
|
|
173
191
|
};
|
|
174
192
|
/** What the studio tells the page. */
|
|
175
193
|
export type ValCanvasStudioMessage = {
|
|
@@ -255,6 +273,24 @@ export type ValCanvasStudioMessage = {
|
|
|
255
273
|
* on a link should follow the link.
|
|
256
274
|
*/
|
|
257
275
|
picking: boolean;
|
|
276
|
+
} | {
|
|
277
|
+
/**
|
|
278
|
+
* Picking ANY element, as the design tab does (`elementPicker.ts`),
|
|
279
|
+
* rather than the fields Val tagged, as `setPicking` does.
|
|
280
|
+
*
|
|
281
|
+
* While `enabled`, holding `modifier` outlines what is under the
|
|
282
|
+
* pointer and a click picks it; `active` picks without the modifier (the
|
|
283
|
+
* tab's Select). Sent whole every time, so a page that missed one
|
|
284
|
+
* message is put right by the next. A bridge that predates it ignores
|
|
285
|
+
* it, and the tab then simply never hears of a pick.
|
|
286
|
+
*/
|
|
287
|
+
val: typeof VAL_CANVAS_MESSAGE;
|
|
288
|
+
type: "pickElements";
|
|
289
|
+
enabled: boolean;
|
|
290
|
+
active: boolean;
|
|
291
|
+
modifier: PickModifier;
|
|
292
|
+
/** Whether the studio still holds the last pick: false takes its outline down. */
|
|
293
|
+
keepPicked: boolean;
|
|
258
294
|
};
|
|
259
295
|
/** Narrow an unknown `event.data` to a message from the page. */
|
|
260
296
|
export declare function isValCanvasPageMessage(data: unknown): data is ValCanvasPageMessage;
|