@react-x11/components 0.7.1 → 0.9.0
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/README.md +295 -51
- package/dist/charts/node.d.ts +1 -1
- package/dist/charts/node.d.ts.map +1 -1
- package/dist/charts/node.js +6 -2
- package/dist/charts/node.js.map +1 -1
- package/dist/color-picker/ColorPicker.d.ts.map +1 -1
- package/dist/color-picker/ColorPicker.js +43 -33
- package/dist/color-picker/ColorPicker.js.map +1 -1
- package/dist/embed/client.d.ts +48 -3
- package/dist/embed/client.d.ts.map +1 -1
- package/dist/embed/client.js +79 -5
- package/dist/embed/client.js.map +1 -1
- package/dist/embed/index.d.ts +1 -1
- package/dist/embed/index.d.ts.map +1 -1
- package/dist/embed/index.js +1 -1
- package/dist/embed/index.js.map +1 -1
- package/dist/html/node.d.ts +3 -1
- package/dist/html/node.d.ts.map +1 -1
- package/dist/html/node.js +7 -5
- package/dist/html/node.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{markdown → internal/markdown}/ast.d.ts +12 -0
- package/dist/internal/markdown/ast.d.ts.map +1 -0
- package/dist/internal/markdown/ast.js +22 -0
- package/dist/internal/markdown/ast.js.map +1 -0
- package/dist/internal/markdown/parse.d.ts.map +1 -0
- package/dist/{markdown → internal/markdown}/parse.js +112 -22
- package/dist/internal/markdown/parse.js.map +1 -0
- package/dist/internal/markdown/stringify.d.ts +4 -0
- package/dist/internal/markdown/stringify.d.ts.map +1 -0
- package/dist/internal/markdown/stringify.js +684 -0
- package/dist/internal/markdown/stringify.js.map +1 -0
- package/dist/internal/markdown/tags.d.ts.map +1 -0
- package/dist/internal/markdown/tags.js.map +1 -0
- package/dist/internal/scroll.d.ts +3 -2
- package/dist/internal/scroll.d.ts.map +1 -1
- package/dist/internal/scroll.js +33 -15
- package/dist/internal/scroll.js.map +1 -1
- package/dist/internal/units.d.ts +2 -0
- package/dist/internal/units.d.ts.map +1 -0
- package/dist/internal/units.js +35 -0
- package/dist/internal/units.js.map +1 -0
- package/dist/internal/window.d.ts.map +1 -1
- package/dist/internal/window.js +4 -2
- package/dist/internal/window.js.map +1 -1
- package/dist/maps/anchors.d.ts +98 -0
- package/dist/maps/anchors.d.ts.map +1 -0
- package/dist/maps/anchors.js +531 -0
- package/dist/maps/anchors.js.map +1 -0
- package/dist/maps/controller.d.ts +283 -0
- package/dist/maps/controller.d.ts.map +1 -0
- package/dist/maps/controller.js +743 -0
- package/dist/maps/controller.js.map +1 -0
- package/dist/maps/gl/buckets.d.ts +95 -0
- package/dist/maps/gl/buckets.d.ts.map +1 -0
- package/dist/maps/gl/buckets.js +362 -0
- package/dist/maps/gl/buckets.js.map +1 -0
- package/dist/maps/gl/build-worker.d.ts +13 -0
- package/dist/maps/gl/build-worker.d.ts.map +1 -0
- package/dist/maps/gl/build-worker.js +44 -0
- package/dist/maps/gl/build-worker.js.map +1 -0
- package/dist/maps/gl/color.d.ts +8 -0
- package/dist/maps/gl/color.d.ts.map +1 -0
- package/dist/maps/gl/color.js +57 -0
- package/dist/maps/gl/color.js.map +1 -0
- package/dist/maps/gl/cover.d.ts +51 -0
- package/dist/maps/gl/cover.d.ts.map +1 -0
- package/dist/maps/gl/cover.js +124 -0
- package/dist/maps/gl/cover.js.map +1 -0
- package/dist/maps/gl/index.d.ts +3 -0
- package/dist/maps/gl/index.d.ts.map +1 -0
- package/dist/maps/gl/index.js +20 -0
- package/dist/maps/gl/index.js.map +1 -0
- package/dist/maps/gl/markers.d.ts +28 -0
- package/dist/maps/gl/markers.d.ts.map +1 -0
- package/dist/maps/gl/markers.js +60 -0
- package/dist/maps/gl/markers.js.map +1 -0
- package/dist/maps/gl/overlays.d.ts +68 -0
- package/dist/maps/gl/overlays.d.ts.map +1 -0
- package/dist/maps/gl/overlays.js +300 -0
- package/dist/maps/gl/overlays.js.map +1 -0
- package/dist/maps/gl/pane.d.ts +12 -0
- package/dist/maps/gl/pane.d.ts.map +1 -0
- package/dist/maps/gl/pane.js +37 -0
- package/dist/maps/gl/pane.js.map +1 -0
- package/dist/maps/gl/placement.d.ts +111 -0
- package/dist/maps/gl/placement.d.ts.map +1 -0
- package/dist/maps/gl/placement.js +567 -0
- package/dist/maps/gl/placement.js.map +1 -0
- package/dist/maps/gl/renderer.d.ts +352 -0
- package/dist/maps/gl/renderer.d.ts.map +1 -0
- package/dist/maps/gl/renderer.js +1127 -0
- package/dist/maps/gl/renderer.js.map +1 -0
- package/dist/maps/gl/shaders.d.ts +120 -0
- package/dist/maps/gl/shaders.d.ts.map +1 -0
- package/dist/maps/gl/shaders.js +451 -0
- package/dist/maps/gl/shaders.js.map +1 -0
- package/dist/maps/gl/store.d.ts +115 -0
- package/dist/maps/gl/store.d.ts.map +1 -0
- package/dist/maps/gl/store.js +469 -0
- package/dist/maps/gl/store.js.map +1 -0
- package/dist/maps/gl/text.d.ts +154 -0
- package/dist/maps/gl/text.d.ts.map +1 -0
- package/dist/maps/gl/text.js +382 -0
- package/dist/maps/gl/text.js.map +1 -0
- package/dist/maps/gl/view.d.ts +54 -0
- package/dist/maps/gl/view.d.ts.map +1 -0
- package/dist/maps/gl/view.js +974 -0
- package/dist/maps/gl/view.js.map +1 -0
- package/dist/maps/index.d.ts +1 -1
- package/dist/maps/index.d.ts.map +1 -1
- package/dist/maps/index.js +216 -52
- package/dist/maps/index.js.map +1 -1
- package/dist/maps/labels.d.ts +37 -16
- package/dist/maps/labels.d.ts.map +1 -1
- package/dist/maps/labels.js +188 -119
- package/dist/maps/labels.js.map +1 -1
- package/dist/maps/node.d.ts +162 -56
- package/dist/maps/node.d.ts.map +1 -1
- package/dist/maps/node.js +607 -515
- package/dist/maps/node.js.map +1 -1
- package/dist/maps/overlay.d.ts +72 -9
- package/dist/maps/overlay.d.ts.map +1 -1
- package/dist/maps/overlay.js +108 -28
- package/dist/maps/overlay.js.map +1 -1
- package/dist/maps/paint.d.ts +3 -0
- package/dist/maps/paint.d.ts.map +1 -1
- package/dist/maps/paint.js.map +1 -1
- package/dist/maps/proj.d.ts +14 -0
- package/dist/maps/proj.d.ts.map +1 -1
- package/dist/maps/proj.js +28 -0
- package/dist/maps/proj.js.map +1 -1
- package/dist/maps/renderer.d.ts +69 -0
- package/dist/maps/renderer.d.ts.map +1 -0
- package/dist/maps/renderer.js +66 -0
- package/dist/maps/renderer.js.map +1 -0
- package/dist/maps/sources.d.ts +25 -3
- package/dist/maps/sources.d.ts.map +1 -1
- package/dist/maps/sources.js +17 -0
- package/dist/maps/sources.js.map +1 -1
- package/dist/maps/theme.d.ts +19 -0
- package/dist/maps/theme.d.ts.map +1 -0
- package/dist/maps/theme.js +44 -0
- package/dist/maps/theme.js.map +1 -0
- package/dist/maps/tiles.d.ts +117 -17
- package/dist/maps/tiles.d.ts.map +1 -1
- package/dist/maps/tiles.js +163 -30
- package/dist/maps/tiles.js.map +1 -1
- package/dist/maps/types.d.ts +188 -20
- package/dist/maps/types.d.ts.map +1 -1
- package/dist/markdown/expressions.d.ts +1 -1
- package/dist/markdown/expressions.d.ts.map +1 -1
- package/dist/markdown/expressions.js.map +1 -1
- package/dist/markdown/index.d.ts +7 -6
- package/dist/markdown/index.d.ts.map +1 -1
- package/dist/markdown/index.js +9 -7
- package/dist/markdown/index.js.map +1 -1
- package/dist/markdown/spans.d.ts +1 -1
- package/dist/markdown/spans.d.ts.map +1 -1
- package/dist/media-player/index.d.ts +11 -3
- package/dist/media-player/index.d.ts.map +1 -1
- package/dist/media-player/index.js +13 -2
- package/dist/media-player/index.js.map +1 -1
- package/dist/rich-text-editor/clipboard.d.ts +23 -0
- package/dist/rich-text-editor/clipboard.d.ts.map +1 -0
- package/dist/rich-text-editor/clipboard.js +307 -0
- package/dist/rich-text-editor/clipboard.js.map +1 -0
- package/dist/rich-text-editor/collab.d.ts +32 -0
- package/dist/rich-text-editor/collab.d.ts.map +1 -0
- package/dist/rich-text-editor/collab.js +55 -0
- package/dist/rich-text-editor/collab.js.map +1 -0
- package/dist/rich-text-editor/commands.d.ts +50 -0
- package/dist/rich-text-editor/commands.d.ts.map +1 -0
- package/dist/rich-text-editor/commands.js +376 -0
- package/dist/rich-text-editor/commands.js.map +1 -0
- package/dist/rich-text-editor/drag.d.ts +68 -0
- package/dist/rich-text-editor/drag.d.ts.map +1 -0
- package/dist/rich-text-editor/drag.js +148 -0
- package/dist/rich-text-editor/drag.js.map +1 -0
- package/dist/rich-text-editor/html.d.ts +145 -0
- package/dist/rich-text-editor/html.d.ts.map +1 -0
- package/dist/rich-text-editor/html.js +516 -0
- package/dist/rich-text-editor/html.js.map +1 -0
- package/dist/rich-text-editor/index.d.ts +263 -0
- package/dist/rich-text-editor/index.d.ts.map +1 -0
- package/dist/rich-text-editor/index.js +822 -0
- package/dist/rich-text-editor/index.js.map +1 -0
- package/dist/rich-text-editor/inline.d.ts +94 -0
- package/dist/rich-text-editor/inline.d.ts.map +1 -0
- package/dist/rich-text-editor/inline.js +252 -0
- package/dist/rich-text-editor/inline.js.map +1 -0
- package/dist/rich-text-editor/keymap.d.ts +71 -0
- package/dist/rich-text-editor/keymap.d.ts.map +1 -0
- package/dist/rich-text-editor/keymap.js +393 -0
- package/dist/rich-text-editor/keymap.js.map +1 -0
- package/dist/rich-text-editor/keys.d.ts +29 -0
- package/dist/rich-text-editor/keys.d.ts.map +1 -0
- package/dist/rich-text-editor/keys.js +93 -0
- package/dist/rich-text-editor/keys.js.map +1 -0
- package/dist/rich-text-editor/look.d.ts +71 -0
- package/dist/rich-text-editor/look.d.ts.map +1 -0
- package/dist/rich-text-editor/look.js +342 -0
- package/dist/rich-text-editor/look.js.map +1 -0
- package/dist/rich-text-editor/markdown.d.ts +18 -0
- package/dist/rich-text-editor/markdown.d.ts.map +1 -0
- package/dist/rich-text-editor/markdown.js +496 -0
- package/dist/rich-text-editor/markdown.js.map +1 -0
- package/dist/rich-text-editor/nodes.d.ts +135 -0
- package/dist/rich-text-editor/nodes.d.ts.map +1 -0
- package/dist/rich-text-editor/nodes.js +397 -0
- package/dist/rich-text-editor/nodes.js.map +1 -0
- package/dist/rich-text-editor/render.d.ts +68 -0
- package/dist/rich-text-editor/render.d.ts.map +1 -0
- package/dist/rich-text-editor/render.js +500 -0
- package/dist/rich-text-editor/render.js.map +1 -0
- package/dist/rich-text-editor/schema.d.ts +16 -0
- package/dist/rich-text-editor/schema.d.ts.map +1 -0
- package/dist/rich-text-editor/schema.js +386 -0
- package/dist/rich-text-editor/schema.js.map +1 -0
- package/dist/rich-text-editor/store.d.ts +11 -0
- package/dist/rich-text-editor/store.d.ts.map +1 -0
- package/dist/rich-text-editor/store.js +43 -0
- package/dist/rich-text-editor/store.js.map +1 -0
- package/dist/rich-text-editor/suggest.d.ts +127 -0
- package/dist/rich-text-editor/suggest.d.ts.map +1 -0
- package/dist/rich-text-editor/suggest.js +0 -0
- package/dist/rich-text-editor/suggest.js.map +1 -0
- package/dist/rich-text-editor/tables.d.ts +41 -0
- package/dist/rich-text-editor/tables.d.ts.map +1 -0
- package/dist/rich-text-editor/tables.js +204 -0
- package/dist/rich-text-editor/tables.js.map +1 -0
- package/dist/rich-text-editor/toolbar.d.ts +58 -0
- package/dist/rich-text-editor/toolbar.d.ts.map +1 -0
- package/dist/rich-text-editor/toolbar.js +548 -0
- package/dist/rich-text-editor/toolbar.js.map +1 -0
- package/dist/rich-text-editor/view.d.ts +368 -0
- package/dist/rich-text-editor/view.d.ts.map +1 -0
- package/dist/rich-text-editor/view.js +1968 -0
- package/dist/rich-text-editor/view.js.map +1 -0
- package/dist/rich-text-editor/virtual.d.ts +54 -0
- package/dist/rich-text-editor/virtual.d.ts.map +1 -0
- package/dist/rich-text-editor/virtual.js +262 -0
- package/dist/rich-text-editor/virtual.js.map +1 -0
- package/dist/richtext/node.d.ts +25 -2
- package/dist/richtext/node.d.ts.map +1 -1
- package/dist/richtext/node.js +46 -24
- package/dist/richtext/node.js.map +1 -1
- package/dist/table/index.d.ts.map +1 -1
- package/dist/table/index.js +14 -5
- package/dist/table/index.js.map +1 -1
- package/dist/terminal/backends.d.ts +4 -1
- package/dist/terminal/backends.d.ts.map +1 -1
- package/dist/terminal/backends.js.map +1 -1
- package/dist/terminal/index.d.ts +18 -7
- package/dist/terminal/index.d.ts.map +1 -1
- package/dist/terminal/index.js +28 -11
- package/dist/terminal/index.js.map +1 -1
- package/dist/terminal/vt/node.d.ts +56 -3
- package/dist/terminal/vt/node.d.ts.map +1 -1
- package/dist/terminal/vt/node.js +106 -26
- package/dist/terminal/vt/node.js.map +1 -1
- package/dist/terminal/vt/renderer.d.ts +4 -0
- package/dist/terminal/vt/renderer.d.ts.map +1 -1
- package/dist/terminal/vt/renderer.js +14 -5
- package/dist/terminal/vt/renderer.js.map +1 -1
- package/dist/tree/index.d.ts.map +1 -1
- package/dist/tree/index.js +6 -4
- package/dist/tree/index.js.map +1 -1
- package/package.json +23 -4
- package/src/charts/node.ts +6 -2
- package/src/color-picker/ColorPicker.ts +107 -81
- package/src/embed/client.ts +102 -8
- package/src/embed/index.ts +2 -0
- package/src/html/node.ts +7 -5
- package/src/index.ts +2 -0
- package/src/{markdown → internal/markdown}/ast.ts +24 -7
- package/src/{markdown → internal/markdown}/parse.ts +134 -24
- package/src/internal/markdown/stringify.ts +772 -0
- package/src/internal/scroll.ts +39 -18
- package/src/internal/units.ts +34 -0
- package/src/internal/window.ts +4 -2
- package/src/maps/anchors.ts +607 -0
- package/src/maps/controller.ts +999 -0
- package/src/maps/gl/buckets.ts +457 -0
- package/src/maps/gl/build-worker.ts +55 -0
- package/src/maps/gl/color.ts +62 -0
- package/src/maps/gl/cover.ts +170 -0
- package/src/maps/gl/index.ts +23 -0
- package/src/maps/gl/markers.ts +83 -0
- package/src/maps/gl/overlays.ts +379 -0
- package/src/maps/gl/pane.ts +42 -0
- package/src/maps/gl/placement.ts +816 -0
- package/src/maps/gl/renderer.ts +1576 -0
- package/src/maps/gl/shaders.ts +486 -0
- package/src/maps/gl/store.ts +566 -0
- package/src/maps/gl/text.ts +495 -0
- package/src/maps/gl/view.ts +1224 -0
- package/src/maps/index.ts +270 -81
- package/src/maps/labels.ts +214 -121
- package/src/maps/node.ts +763 -629
- package/src/maps/overlay.ts +148 -43
- package/src/maps/paint.ts +3 -0
- package/src/maps/proj.ts +31 -0
- package/src/maps/renderer.ts +155 -0
- package/src/maps/sources.ts +38 -3
- package/src/maps/theme.ts +51 -0
- package/src/maps/tiles.ts +191 -33
- package/src/maps/types.ts +188 -20
- package/src/markdown/expressions.ts +5 -1
- package/src/markdown/index.ts +14 -11
- package/src/markdown/spans.ts +1 -1
- package/src/media-player/index.ts +18 -4
- package/src/rich-text-editor/clipboard.ts +439 -0
- package/src/rich-text-editor/collab.ts +91 -0
- package/src/rich-text-editor/commands.ts +448 -0
- package/src/rich-text-editor/dom-globals.d.ts +23 -0
- package/src/rich-text-editor/drag.ts +211 -0
- package/src/rich-text-editor/html.ts +619 -0
- package/src/rich-text-editor/index.ts +1331 -0
- package/src/rich-text-editor/inline.ts +345 -0
- package/src/rich-text-editor/keymap.ts +510 -0
- package/src/rich-text-editor/keys.ts +119 -0
- package/src/rich-text-editor/look.ts +427 -0
- package/src/rich-text-editor/markdown.ts +653 -0
- package/src/rich-text-editor/nodes.ts +497 -0
- package/src/rich-text-editor/render.ts +800 -0
- package/src/rich-text-editor/schema.ts +431 -0
- package/src/rich-text-editor/store.ts +39 -0
- package/src/rich-text-editor/suggest.ts +597 -0
- package/src/rich-text-editor/tables.ts +272 -0
- package/src/rich-text-editor/toolbar.ts +724 -0
- package/src/rich-text-editor/view.ts +2287 -0
- package/src/rich-text-editor/virtual.ts +347 -0
- package/src/richtext/node.ts +59 -30
- package/src/table/index.ts +14 -5
- package/src/terminal/backends.ts +4 -1
- package/src/terminal/index.ts +43 -15
- package/src/terminal/vt/node.ts +128 -29
- package/src/terminal/vt/renderer.ts +27 -5
- package/src/tree/index.ts +6 -4
- package/dist/markdown/ast.d.ts.map +0 -1
- package/dist/markdown/ast.js +0 -17
- package/dist/markdown/ast.js.map +0 -1
- package/dist/markdown/parse.d.ts.map +0 -1
- package/dist/markdown/parse.js.map +0 -1
- package/dist/markdown/tags.d.ts.map +0 -1
- package/dist/markdown/tags.js.map +0 -1
- /package/dist/{markdown → internal/markdown}/parse.d.ts +0 -0
- /package/dist/{markdown → internal/markdown}/tags.d.ts +0 -0
- /package/dist/{markdown → internal/markdown}/tags.js +0 -0
- /package/src/{markdown → internal/markdown}/tags.ts +0 -0
package/dist/maps/node.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { A11ySceneItem, Context2D } from 'react-x11/node';
|
|
|
3
3
|
import type { KeyboardEvent, MouseEvent, WheelEvent } from 'react-x11';
|
|
4
4
|
import type { LngLat, LngLatBounds, MapCamera } from './proj.js';
|
|
5
5
|
import type { MapMarker } from './overlay.js';
|
|
6
|
-
import type { MapFrameStats } from './types.js';
|
|
6
|
+
import type { FitBoundsOptions, MapFrameStats } from './types.js';
|
|
7
7
|
/** Registration key, `kind` and JSX tag, one string — react-x11 rejects a
|
|
8
8
|
* node whose `kind` is not the name it was registered under, because
|
|
9
9
|
* `kind` is what paint order, the test queries and the DEV style assertion
|
|
@@ -22,35 +22,50 @@ export declare const SELF_DAMAGED_PROPS: readonly ['camera', 'markers', 'overlay
|
|
|
22
22
|
export declare class MapViewNode extends Node {
|
|
23
23
|
private readonly _cache;
|
|
24
24
|
private readonly _scratch;
|
|
25
|
-
private readonly _geometry;
|
|
26
25
|
private _shaper;
|
|
27
26
|
/**
|
|
28
|
-
* The camera
|
|
27
|
+
* The camera and the gestures: the controller `<Map>` hands down, or this
|
|
28
|
+
* element's own when it is used bare. Both of `<Map>`'s renderers answer
|
|
29
|
+
* to one (`./controller.ts`), which is how a fallback from one to the
|
|
30
|
+
* other keeps the camera and the handle.
|
|
29
31
|
*
|
|
30
|
-
* The
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
32
|
+
* The camera being an object's rather than React state's is what makes a
|
|
33
|
+
* pan cost nothing but a blit: a drag step moves two numbers and claims a
|
|
34
|
+
* strip, and React is not involved at all. Routed through state instead,
|
|
35
|
+
* every pointer step would be a render, a commit and a full-pane claim,
|
|
36
|
+
* which is the shape `<Flow>` documents as "the content lags and catches
|
|
37
|
+
* up".
|
|
36
38
|
*/
|
|
37
|
-
private
|
|
39
|
+
private readonly _controller;
|
|
40
|
+
private readonly _ownsController;
|
|
41
|
+
/** This element, as its controller sees it. */
|
|
42
|
+
private readonly _view;
|
|
38
43
|
private _prepared;
|
|
39
44
|
private _preparedFrom;
|
|
40
45
|
private _defaultStyle;
|
|
41
46
|
/** The placement, and what it was computed for. */
|
|
42
47
|
private _labels;
|
|
43
48
|
private _labelKey;
|
|
49
|
+
/** …and what it was placed from, all of which a restyle holds on to (see
|
|
50
|
+
* {@link Outgoing}): the quantized zoom, the sources on the map, their
|
|
51
|
+
* candidates per source, and the face they were shaped in. */
|
|
52
|
+
private _labelZoom;
|
|
53
|
+
private _labelSources;
|
|
54
|
+
private _labelCandidates;
|
|
55
|
+
private _shapedFamily;
|
|
44
56
|
/** Candidates per tile, so a pan that brings a tile back does not redo
|
|
45
57
|
* the walk over its symbol layers. */
|
|
46
58
|
private readonly _candidates;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
private
|
|
59
|
+
/** The previous style while a restyle draws the new one behind it, or
|
|
60
|
+
* null when what is on screen is the current generation. */
|
|
61
|
+
private _outgoing;
|
|
62
|
+
/** The style background the last frame painted — what a restyle keeps
|
|
63
|
+
* painting. Remembered rather than recomputed, because `refresh()`
|
|
64
|
+
* follows an edit made to the very style object it would be read from. */
|
|
65
|
+
private _paintedBackground;
|
|
66
|
+
/** Whether a frame has been painted: before one, a restyle has no
|
|
67
|
+
* previous picture to hold. */
|
|
68
|
+
private _painted;
|
|
54
69
|
/** Whether any tile has been rasterized in the frame being painted — the
|
|
55
70
|
* forward-progress guarantee below. */
|
|
56
71
|
private _rastered;
|
|
@@ -67,10 +82,9 @@ export declare class MapViewNode extends Node {
|
|
|
67
82
|
private _isDark;
|
|
68
83
|
private _palette;
|
|
69
84
|
private _sources;
|
|
85
|
+
/** What a source is called in its requests and its errors. Not what its
|
|
86
|
+
* tiles are cached under — the cache files them under the object. */
|
|
70
87
|
private _sourceId;
|
|
71
|
-
private _minZoom;
|
|
72
|
-
private _maxZoom;
|
|
73
|
-
private _interactive;
|
|
74
88
|
private _markers;
|
|
75
89
|
private _overlays;
|
|
76
90
|
/** The pane in logical pixels — the unit everything public here speaks.
|
|
@@ -99,14 +113,6 @@ export declare class MapViewNode extends Node {
|
|
|
99
113
|
* visible burst of repaints at the end of every zoom.
|
|
100
114
|
*/
|
|
101
115
|
private _wake;
|
|
102
|
-
/**
|
|
103
|
-
* Move the camera.
|
|
104
|
-
*
|
|
105
|
-
* The one place the camera changes, so the controlled/uncontrolled fork,
|
|
106
|
-
* the clamping, the notification and — the interesting part — the
|
|
107
|
-
* decision between a blit and a repaint all live together.
|
|
108
|
-
*/
|
|
109
|
-
private _applyCamera;
|
|
110
116
|
/**
|
|
111
117
|
* A pan is a scroll in every way but the bookkeeping, and react-x11#303
|
|
112
118
|
* made the bookkeeping public: `scrollContents` claims the pane, arms the
|
|
@@ -125,12 +131,9 @@ export declare class MapViewNode extends Node {
|
|
|
125
131
|
* whole device pixels, because that is how it came off the wire.
|
|
126
132
|
*/
|
|
127
133
|
private _blitPan;
|
|
128
|
-
/**
|
|
129
|
-
*
|
|
130
|
-
|
|
131
|
-
/** Suspend rasterization for the length of a gesture, and arrange for it
|
|
132
|
-
* to resume. */
|
|
133
|
-
private _touchGesture;
|
|
134
|
+
/** A gesture in flight, or the settle window after a camera move: while
|
|
135
|
+
* it lasts nothing is rasterized, so a drag or a wheel is composites
|
|
136
|
+
* only. The window is the controller's, and one for both renderers. */
|
|
134
137
|
private get _gesturing();
|
|
135
138
|
getCamera(): MapCamera;
|
|
136
139
|
setCamera(camera: Partial<MapCamera>): void;
|
|
@@ -139,14 +142,8 @@ export declare class MapViewNode extends Node {
|
|
|
139
142
|
zoomIn(step?: number): void;
|
|
140
143
|
zoomOut(step?: number): void;
|
|
141
144
|
zoomTo(zoom: number): void;
|
|
142
|
-
fitBounds(bounds: LngLatBounds, options?:
|
|
143
|
-
|
|
144
|
-
maxZoom?: number;
|
|
145
|
-
}): void;
|
|
146
|
-
fitMarkers(ids?: readonly string[], options?: {
|
|
147
|
-
padding?: number;
|
|
148
|
-
maxZoom?: number;
|
|
149
|
-
}): void;
|
|
145
|
+
fitBounds(bounds: LngLatBounds, options?: FitBoundsOptions): void;
|
|
146
|
+
fitMarkers(ids?: readonly string[], options?: FitBoundsOptions): void;
|
|
150
147
|
getBounds(): LngLatBounds;
|
|
151
148
|
project(position: LngLat): {
|
|
152
149
|
x: number;
|
|
@@ -155,8 +152,25 @@ export declare class MapViewNode extends Node {
|
|
|
155
152
|
unproject(x: number, y: number): LngLat;
|
|
156
153
|
markerAt(x: number, y: number): MapMarker | null;
|
|
157
154
|
refresh(): void;
|
|
155
|
+
/**
|
|
156
|
+
* Retire every rendered tile — for a new `mapStyle`, or `refresh()` after
|
|
157
|
+
* an edit made to the style in place. One path for both, and for anything
|
|
158
|
+
* else that ever needs the map redrawn in a new look.
|
|
159
|
+
*
|
|
160
|
+
* The compiled style and the label candidates go with the tiles: both are
|
|
161
|
+
* readings of the style, and `refresh()` exists because the object was
|
|
162
|
+
* edited under them. What does not go is the picture on screen. Unless
|
|
163
|
+
* there is none yet, or `progressive` asked to watch the repaint, it is
|
|
164
|
+
* held as {@link Outgoing} until the new one is ready to replace it.
|
|
165
|
+
*
|
|
166
|
+
* True when it is held. Then nothing on screen changes yet, so the only
|
|
167
|
+
* claim is the pixel that asks for a frame to start drawing in — and
|
|
168
|
+
* anything else a commit changed has to claim its own damage.
|
|
169
|
+
*/
|
|
170
|
+
private _restyle;
|
|
171
|
+
/** The camera and the pane, as a string that changes when either does. */
|
|
172
|
+
private _viewKey;
|
|
158
173
|
stats(): MapFrameStats | null;
|
|
159
|
-
private _pendingFit;
|
|
160
174
|
/** How tall the attribution strip is, in logical pixels — 0 when there is
|
|
161
175
|
* nothing to say. Read by the blit as well as the paint, so the band it
|
|
162
176
|
* carves out and the band that is drawn are one number. */
|
|
@@ -170,7 +184,69 @@ export declare class MapViewNode extends Node {
|
|
|
170
184
|
paint(ctx: Context2D): void;
|
|
171
185
|
private _preparedBackground;
|
|
172
186
|
private _deviceRect;
|
|
173
|
-
|
|
187
|
+
/**
|
|
188
|
+
* Whether this frame keeps showing the previous style or swaps in the new
|
|
189
|
+
* one — see {@link Outgoing}.
|
|
190
|
+
*
|
|
191
|
+
* The swap waits for every tile in view that has data to have a finished
|
|
192
|
+
* rendering in the new style, which is `pending` reaching zero: a tile
|
|
193
|
+
* still loading has nothing to draw and does not hold it, and a tile that
|
|
194
|
+
* is done waits for the rest rather than going up alone. It is made only
|
|
195
|
+
* in a frame that repaints the whole pane, because a swap inside a partial
|
|
196
|
+
* frame would leave the rest of the pane in the old style — so a frame
|
|
197
|
+
* that finds the view redrawn but was clipped to its one pixel claims the
|
|
198
|
+
* pane, and the next frame swaps. That is the one full-pane claim a
|
|
199
|
+
* restyle makes.
|
|
200
|
+
*
|
|
201
|
+
* Or, once the view has moved, when {@link RESTYLE_WAIT_MS} of drawing
|
|
202
|
+
* time has gone by, with whatever is left undrawn.
|
|
203
|
+
*/
|
|
204
|
+
private _settleRestyle;
|
|
205
|
+
/** The new style goes on screen: every finished tile, its background and
|
|
206
|
+
* a label placement of its own, all in the frame being painted. */
|
|
207
|
+
private _swapStyle;
|
|
208
|
+
/**
|
|
209
|
+
* A frame's work, for one source: want every tile of its cover, so that
|
|
210
|
+
* each loads and stays cached, and draw the ones in view into their own
|
|
211
|
+
* surfaces as far as the budget goes. Returns the ones in view, for
|
|
212
|
+
* {@link _drawSource} to composite once the frame knows which style it is
|
|
213
|
+
* showing.
|
|
214
|
+
*/
|
|
215
|
+
private _workSource;
|
|
216
|
+
/**
|
|
217
|
+
* The cover, with every **raster** tile past the source's depth drawn as
|
|
218
|
+
* the whole of its data tile — once, however many of its cells there are.
|
|
219
|
+
*
|
|
220
|
+
* The cover goes deeper than the source cuts because that is what makes
|
|
221
|
+
* vector data sharp there: each cell is rasterized from its data tile's
|
|
222
|
+
* features, through the cell (`sub`, in `_rasterize`). An image has no
|
|
223
|
+
* detail finer than its pixels and no drawing it through a cell: a raster
|
|
224
|
+
* cell was drawn by uploading the image, all of it, so each cell showed
|
|
225
|
+
* its data tile whole, shrunk into its own square. Past a raster source's
|
|
226
|
+
* depth the map was a grid of miniatures of each tile — 2×2 one level
|
|
227
|
+
* past, 4×4 two — and a 256px source is read a level deeper than the
|
|
228
|
+
* view, so for `osmRasterSource`, which cuts at 19, that was every zoom
|
|
229
|
+
* from 19 up.
|
|
230
|
+
*
|
|
231
|
+
* A raster map past its provider's depth draws the deepest images larger,
|
|
232
|
+
* and so does this. The square is where the cover at the source's own
|
|
233
|
+
* depth puts the data tile, and it is drawn from that tile's own surface —
|
|
234
|
+
* the one the view at that depth draws, so crossing into overzoom uploads
|
|
235
|
+
* nothing.
|
|
236
|
+
*
|
|
237
|
+
* Which kind a tile is, is known once its data is in. Until then a cell
|
|
238
|
+
* stays a cell, and is covered from its neighbours in the pyramid like
|
|
239
|
+
* any other hole. Asking is a `want`, which the frame's own pass repeats
|
|
240
|
+
* for a cell kept here, and which is idempotent.
|
|
241
|
+
*/
|
|
242
|
+
private _rasterSquares;
|
|
243
|
+
/**
|
|
244
|
+
* A frame's picture, for one source: composite each tile in view from its
|
|
245
|
+
* own finished rendering or, for a tile with none, from a finished
|
|
246
|
+
* ancestor or descendants. Only renderings of `generation` count, and
|
|
247
|
+
* `undefined` counts any — which is `progressive`.
|
|
248
|
+
*/
|
|
249
|
+
private _drawSource;
|
|
174
250
|
/**
|
|
175
251
|
* Rasterize as much of a tile as the budget allows, run by run.
|
|
176
252
|
*
|
|
@@ -220,6 +296,16 @@ export declare class MapViewNode extends Node {
|
|
|
220
296
|
* point. Clipping the destination and moving the source rectangle to
|
|
221
297
|
* match keeps the scale factor `sw/dw` exactly what it was, so nothing
|
|
222
298
|
* about the picture changes.
|
|
299
|
+
*
|
|
300
|
+
* **`dest` is already in the window's space**, the one `pane` is in — a
|
|
301
|
+
* tile's `box` is `pane.x + entry.x` — so nothing is added to it here.
|
|
302
|
+
* The pane's origin used to be added a second time, which drew every
|
|
303
|
+
* tile that far right of and below where the markers, labels and
|
|
304
|
+
* overlays put the same place. A constant offset on screen is a
|
|
305
|
+
* different distance on the ground at every zoom, so it looked like a
|
|
306
|
+
* marker sliding across the map as it zoomed, and like nothing at all as
|
|
307
|
+
* it panned, where the blit moves both together. Every test mounted the
|
|
308
|
+
* map at the window's origin, where the offset is zero.
|
|
223
309
|
*/
|
|
224
310
|
private _composite;
|
|
225
311
|
/**
|
|
@@ -243,11 +329,12 @@ export declare class MapViewNode extends Node {
|
|
|
243
329
|
* somewhere else.
|
|
244
330
|
*/
|
|
245
331
|
private _paintAttribution;
|
|
246
|
-
/**
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
|
|
250
|
-
|
|
332
|
+
/**
|
|
333
|
+
* An event as the controller reads it. A synthetic event's `x`/`y` are
|
|
334
|
+
* logical and relative to the window, so only the pane's own origin has
|
|
335
|
+
* to come off.
|
|
336
|
+
*/
|
|
337
|
+
private _input;
|
|
251
338
|
defaultMouseDown(ev: MouseEvent): void;
|
|
252
339
|
defaultMouseDrag(ev: MouseEvent): void;
|
|
253
340
|
defaultMouseUp(ev: MouseEvent): void;
|
|
@@ -261,16 +348,35 @@ export declare class MapViewNode extends Node {
|
|
|
261
348
|
*/
|
|
262
349
|
defaultWheel(ev: WheelEvent): void;
|
|
263
350
|
defaultKeyDown(ev: KeyboardEvent): void;
|
|
351
|
+
/** What a screen reader meets: the markers in view, as buttons — the
|
|
352
|
+
* controller's answer, which both renderers give. */
|
|
353
|
+
a11yScene(): A11ySceneItem[];
|
|
354
|
+
/** Every source this element has been handed, and how many `sources`
|
|
355
|
+
* changes in a row have made a slot anew — see `_noticeRemade`. */
|
|
356
|
+
private readonly _seenSources;
|
|
357
|
+
private _remade;
|
|
358
|
+
private _warnedRemade;
|
|
264
359
|
/**
|
|
265
|
-
*
|
|
360
|
+
* Say so, once, when the application makes a source anew on every
|
|
361
|
+
* render.
|
|
266
362
|
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
* camera
|
|
271
|
-
*
|
|
363
|
+
* Tiles are cached per source object (see `./tiles.ts`), so a source
|
|
364
|
+
* rebuilt on each render starts from an empty cache on each render: every
|
|
365
|
+
* tile in view is fetched again, and the map is its background until they
|
|
366
|
+
* land. Under a controlled camera that is a render per pan step — a drag
|
|
367
|
+
* across a blank map that fetches the whole view on every step.
|
|
368
|
+
*
|
|
369
|
+
* What gives it away is a slot handed a source this element has never
|
|
370
|
+
* had, looking like the one it replaces — the same id, pyramid and
|
|
371
|
+
* attribution — on three `sources` changes in a row. A provider switch
|
|
372
|
+
* does that once, and a switch back to a source already shown does not
|
|
373
|
+
* count at all. Looking alike is only ever the basis of a warning, never
|
|
374
|
+
* of a cache key: two providers can look exactly alike.
|
|
375
|
+
*
|
|
376
|
+
* `process` and `console` come off `globalThis` because `src/` compiles
|
|
377
|
+
* with `types: []`, as for the terminal's warning.
|
|
272
378
|
*/
|
|
273
|
-
|
|
379
|
+
private _noticeRemade;
|
|
274
380
|
applyProps(next: Record<string, unknown>, prev: Record<string, unknown>): void;
|
|
275
381
|
private _claimOverlayDamage;
|
|
276
382
|
destroySubtree(): void;
|
package/dist/maps/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/maps/node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/maps/node.ts"],"names":[],"mappings":"AA8BA,OAA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