@react-x11/components 0.8.0 → 0.10.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 +105 -38
- package/dist/charts/node.d.ts +12 -2
- package/dist/charts/node.d.ts.map +1 -1
- package/dist/charts/node.js +50 -16
- package/dist/charts/node.js.map +1 -1
- package/dist/charts/render.d.ts +12 -3
- package/dist/charts/render.d.ts.map +1 -1
- package/dist/charts/render.js +94 -25
- package/dist/charts/render.js.map +1 -1
- package/dist/code/index.d.ts.map +1 -1
- package/dist/code/index.js +3 -1
- package/dist/code/index.js.map +1 -1
- package/dist/code-editor/completion.d.ts.map +1 -1
- package/dist/code-editor/completion.js +3 -2
- package/dist/code-editor/completion.js.map +1 -1
- package/dist/code-editor/index.d.ts.map +1 -1
- package/dist/code-editor/index.js +19 -0
- package/dist/code-editor/index.js.map +1 -1
- package/dist/code-editor/node.d.ts +177 -7
- package/dist/code-editor/node.d.ts.map +1 -1
- package/dist/code-editor/node.js +1329 -164
- package/dist/code-editor/node.js.map +1 -1
- package/dist/code-language/languages/glsl.d.ts.map +1 -1
- package/dist/code-language/languages/glsl.js +10 -2
- package/dist/code-language/languages/glsl.js.map +1 -1
- package/dist/code-language/languages/javascript.d.ts.map +1 -1
- package/dist/code-language/languages/javascript.js +18 -3
- package/dist/code-language/languages/javascript.js.map +1 -1
- package/dist/code-language/languages/json.d.ts.map +1 -1
- package/dist/code-language/languages/json.js +10 -2
- package/dist/code-language/languages/json.js.map +1 -1
- package/dist/code-language/languages/shell.d.ts.map +1 -1
- package/dist/code-language/languages/shell.js +10 -2
- package/dist/code-language/languages/shell.js.map +1 -1
- package/dist/code-language/languages/sql.d.ts.map +1 -1
- package/dist/code-language/languages/sql.js +20 -2
- package/dist/code-language/languages/sql.js.map +1 -1
- package/dist/code-language/stream.d.ts +22 -0
- package/dist/code-language/stream.d.ts.map +1 -1
- package/dist/code-language/stream.js +259 -9
- package/dist/code-language/stream.js.map +1 -1
- package/dist/code-language/types.d.ts +5 -4
- package/dist/code-language/types.d.ts.map +1 -1
- package/dist/codeblock/index.d.ts +13 -2
- package/dist/codeblock/index.d.ts.map +1 -1
- package/dist/codeblock/index.js +20 -3
- package/dist/codeblock/index.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/flow/draw.d.ts +50 -0
- package/dist/flow/draw.d.ts.map +1 -1
- package/dist/flow/draw.js +132 -33
- package/dist/flow/draw.js.map +1 -1
- package/dist/flow/gl/color.d.ts +13 -0
- package/dist/flow/gl/color.d.ts.map +1 -0
- package/dist/flow/gl/color.js +82 -0
- package/dist/flow/gl/color.js.map +1 -0
- package/dist/flow/gl/index.d.ts +60 -0
- package/dist/flow/gl/index.d.ts.map +1 -0
- package/dist/flow/gl/index.js +283 -0
- package/dist/flow/gl/index.js.map +1 -0
- package/dist/flow/gl/pack.d.ts +133 -0
- package/dist/flow/gl/pack.d.ts.map +1 -0
- package/dist/flow/gl/pack.js +408 -0
- package/dist/flow/gl/pack.js.map +1 -0
- package/dist/flow/gl/renderer.d.ts +95 -0
- package/dist/flow/gl/renderer.d.ts.map +1 -0
- package/dist/flow/gl/renderer.js +459 -0
- package/dist/flow/gl/renderer.js.map +1 -0
- package/dist/flow/gl/shaders.d.ts +79 -0
- package/dist/flow/gl/shaders.d.ts.map +1 -0
- package/dist/flow/gl/shaders.js +346 -0
- package/dist/flow/gl/shaders.js.map +1 -0
- package/dist/flow/gl/text.d.ts +318 -0
- package/dist/flow/gl/text.d.ts.map +1 -0
- package/dist/flow/gl/text.js +1103 -0
- package/dist/flow/gl/text.js.map +1 -0
- package/dist/flow/index.d.ts +1 -1
- package/dist/flow/index.d.ts.map +1 -1
- package/dist/flow/index.js +619 -64
- package/dist/flow/index.js.map +1 -1
- package/dist/flow/node.d.ts +621 -72
- package/dist/flow/node.d.ts.map +1 -1
- package/dist/flow/node.js +2253 -1018
- package/dist/flow/node.js.map +1 -1
- package/dist/flow/paint.d.ts +35 -0
- package/dist/flow/paint.d.ts.map +1 -0
- package/dist/flow/paint.js +393 -0
- package/dist/flow/paint.js.map +1 -0
- package/dist/flow/paths.d.ts +14 -0
- package/dist/flow/paths.d.ts.map +1 -1
- package/dist/flow/paths.js +45 -19
- package/dist/flow/paths.js.map +1 -1
- package/dist/flow/scene.d.ts +584 -0
- package/dist/flow/scene.d.ts.map +1 -0
- package/dist/flow/scene.js +1453 -0
- package/dist/flow/scene.js.map +1 -0
- package/dist/flow/types.d.ts +111 -1
- package/dist/flow/types.d.ts.map +1 -1
- package/dist/html/controls.d.ts +28 -0
- package/dist/html/controls.d.ts.map +1 -1
- package/dist/html/controls.js +52 -2
- package/dist/html/controls.js.map +1 -1
- package/dist/html/css/calc.d.ts +14 -0
- package/dist/html/css/calc.d.ts.map +1 -0
- package/dist/html/css/calc.js +344 -0
- package/dist/html/css/calc.js.map +1 -0
- package/dist/html/css/cascade.d.ts +240 -6
- package/dist/html/css/cascade.d.ts.map +1 -1
- package/dist/html/css/cascade.js +1327 -66
- package/dist/html/css/cascade.js.map +1 -1
- package/dist/html/css/color.d.ts +23 -0
- package/dist/html/css/color.d.ts.map +1 -0
- package/dist/html/css/color.js +740 -0
- package/dist/html/css/color.js.map +1 -0
- package/dist/html/css/content.d.ts +92 -0
- package/dist/html/css/content.d.ts.map +1 -0
- package/dist/html/css/content.js +388 -0
- package/dist/html/css/content.js.map +1 -0
- package/dist/html/css/counter-styles.d.ts +76 -0
- package/dist/html/css/counter-styles.d.ts.map +1 -0
- package/dist/html/css/counter-styles.js +893 -0
- package/dist/html/css/counter-styles.js.map +1 -0
- package/dist/html/css/decode.d.ts +12 -0
- package/dist/html/css/decode.d.ts.map +1 -0
- package/dist/html/css/decode.js +116 -0
- package/dist/html/css/decode.js.map +1 -0
- package/dist/html/css/parse.d.ts +110 -10
- package/dist/html/css/parse.d.ts.map +1 -1
- package/dist/html/css/parse.js +1473 -180
- package/dist/html/css/parse.js.map +1 -1
- package/dist/html/css/style.d.ts +498 -15
- package/dist/html/css/style.d.ts.map +1 -1
- package/dist/html/css/style.js +3698 -206
- package/dist/html/css/style.js.map +1 -1
- package/dist/html/css/ua.d.ts.map +1 -1
- package/dist/html/css/ua.js +57 -11
- package/dist/html/css/ua.js.map +1 -1
- package/dist/html/css/values.d.ts +37 -3
- package/dist/html/css/values.d.ts.map +1 -1
- package/dist/html/css/values.js +122 -48
- package/dist/html/css/values.js.map +1 -1
- package/dist/html/css/vars.d.ts +52 -0
- package/dist/html/css/vars.d.ts.map +1 -0
- package/dist/html/css/vars.js +358 -0
- package/dist/html/css/vars.js.map +1 -0
- package/dist/html/dom.d.ts +30 -4
- package/dist/html/dom.d.ts.map +1 -1
- package/dist/html/dom.js +278 -17
- package/dist/html/dom.js.map +1 -1
- package/dist/html/fonts.d.ts +106 -0
- package/dist/html/fonts.d.ts.map +1 -0
- package/dist/html/fonts.js +565 -0
- package/dist/html/fonts.js.map +1 -0
- package/dist/html/gif.d.ts +15 -0
- package/dist/html/gif.d.ts.map +1 -0
- package/dist/html/gif.js +229 -0
- package/dist/html/gif.js.map +1 -0
- package/dist/html/index.d.ts +50 -11
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +115 -9
- package/dist/html/index.js.map +1 -1
- package/dist/html/layout/block.d.ts +226 -3
- package/dist/html/layout/block.d.ts.map +1 -1
- package/dist/html/layout/block.js +2937 -197
- package/dist/html/layout/block.js.map +1 -1
- package/dist/html/layout/boxes.d.ts +340 -17
- package/dist/html/layout/boxes.d.ts.map +1 -1
- package/dist/html/layout/boxes.js +1714 -182
- package/dist/html/layout/boxes.js.map +1 -1
- package/dist/html/layout/cache.d.ts +58 -0
- package/dist/html/layout/cache.d.ts.map +1 -0
- package/dist/html/layout/cache.js +224 -0
- package/dist/html/layout/cache.js.map +1 -0
- package/dist/html/layout/collapse.d.ts +45 -0
- package/dist/html/layout/collapse.d.ts.map +1 -0
- package/dist/html/layout/collapse.js +246 -0
- package/dist/html/layout/collapse.js.map +1 -0
- package/dist/html/layout/css-grid.d.ts +7 -0
- package/dist/html/layout/css-grid.d.ts.map +1 -0
- package/dist/html/layout/css-grid.js +900 -0
- package/dist/html/layout/css-grid.js.map +1 -0
- package/dist/html/layout/flex.d.ts.map +1 -1
- package/dist/html/layout/flex.js +1025 -89
- package/dist/html/layout/flex.js.map +1 -1
- package/dist/html/layout/floats.d.ts +45 -6
- package/dist/html/layout/floats.d.ts.map +1 -1
- package/dist/html/layout/floats.js +113 -14
- package/dist/html/layout/floats.js.map +1 -1
- package/dist/html/layout/grid-lines.d.ts +39 -0
- package/dist/html/layout/grid-lines.d.ts.map +1 -0
- package/dist/html/layout/grid-lines.js +119 -0
- package/dist/html/layout/grid-lines.js.map +1 -0
- package/dist/html/layout/grid.d.ts +53 -0
- package/dist/html/layout/grid.d.ts.map +1 -0
- package/dist/html/layout/grid.js +153 -0
- package/dist/html/layout/grid.js.map +1 -0
- package/dist/html/layout/inline.d.ts +151 -1
- package/dist/html/layout/inline.d.ts.map +1 -1
- package/dist/html/layout/inline.js +3375 -174
- package/dist/html/layout/inline.js.map +1 -1
- package/dist/html/layout/shaping.d.ts +6 -0
- package/dist/html/layout/shaping.d.ts.map +1 -0
- package/dist/html/layout/shaping.js +100 -0
- package/dist/html/layout/shaping.js.map +1 -0
- package/dist/html/layout/table.d.ts +3 -0
- package/dist/html/layout/table.d.ts.map +1 -1
- package/dist/html/layout/table.js +681 -175
- package/dist/html/layout/table.js.map +1 -1
- package/dist/html/layout/tracks.d.ts +44 -0
- package/dist/html/layout/tracks.d.ts.map +1 -0
- package/dist/html/layout/tracks.js +349 -0
- package/dist/html/layout/tracks.js.map +1 -0
- package/dist/html/node.d.ts +172 -5
- package/dist/html/node.d.ts.map +1 -1
- package/dist/html/node.js +1336 -103
- package/dist/html/node.js.map +1 -1
- package/dist/html/paint.d.ts +92 -3
- package/dist/html/paint.d.ts.map +1 -1
- package/dist/html/paint.js +3503 -141
- package/dist/html/paint.js.map +1 -1
- package/dist/html/resources.d.ts +60 -14
- package/dist/html/resources.d.ts.map +1 -1
- package/dist/html/resources.js +122 -36
- package/dist/html/resources.js.map +1 -1
- package/dist/html/surfaces.d.ts +23 -0
- package/dist/html/surfaces.d.ts.map +1 -0
- package/dist/html/surfaces.js +68 -0
- package/dist/html/surfaces.js.map +1 -0
- package/dist/html/svg.d.ts +80 -0
- package/dist/html/svg.d.ts.map +1 -0
- package/dist/html/svg.js +435 -0
- package/dist/html/svg.js.map +1 -0
- package/dist/html/url.d.ts +23 -0
- package/dist/html/url.d.ts.map +1 -0
- package/dist/html/url.js +80 -0
- package/dist/html/url.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/collate.d.ts +3 -0
- package/dist/internal/collate.d.ts.map +1 -0
- package/dist/internal/collate.js +11 -0
- package/dist/internal/collate.js.map +1 -0
- package/dist/{markdown → internal/markdown}/ast.d.ts +23 -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 +221 -30
- 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/prewarm.d.ts +18 -0
- package/dist/internal/prewarm.d.ts.map +1 -0
- package/dist/internal/prewarm.js +42 -0
- package/dist/internal/prewarm.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 +1 -0
- package/dist/internal/scroll.js.map +1 -1
- package/dist/internal/sdf.d.ts +20 -0
- package/dist/internal/sdf.d.ts.map +1 -0
- package/dist/internal/sdf.js +216 -0
- package/dist/internal/sdf.js.map +1 -0
- package/dist/internal/splice.d.ts +12 -0
- package/dist/internal/splice.d.ts.map +1 -0
- package/dist/internal/splice.js +23 -0
- package/dist/internal/splice.js.map +1 -0
- package/dist/internal/window.d.ts +12 -0
- package/dist/internal/window.d.ts.map +1 -1
- package/dist/internal/window.js +23 -6
- package/dist/internal/window.js.map +1 -1
- package/dist/maps/anchors.d.ts +103 -0
- package/dist/maps/anchors.d.ts.map +1 -0
- package/dist/maps/anchors.js +790 -0
- package/dist/maps/anchors.js.map +1 -0
- package/dist/maps/controller.d.ts +340 -0
- package/dist/maps/controller.d.ts.map +1 -0
- package/dist/maps/controller.js +822 -0
- package/dist/maps/controller.js.map +1 -0
- package/dist/maps/gl/buckets.d.ts +99 -0
- package/dist/maps/gl/buckets.d.ts.map +1 -0
- package/dist/maps/gl/buckets.js +365 -0
- package/dist/maps/gl/buckets.js.map +1 -0
- package/dist/maps/gl/build-worker.d.ts +15 -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 +70 -0
- package/dist/maps/gl/cover.d.ts.map +1 -0
- package/dist/maps/gl/cover.js +137 -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 +124 -0
- package/dist/maps/gl/placement.d.ts.map +1 -0
- package/dist/maps/gl/placement.js +642 -0
- package/dist/maps/gl/placement.js.map +1 -0
- package/dist/maps/gl/renderer.d.ts +384 -0
- package/dist/maps/gl/renderer.d.ts.map +1 -0
- package/dist/maps/gl/renderer.js +1184 -0
- package/dist/maps/gl/renderer.js.map +1 -0
- package/dist/maps/gl/shaders.d.ts +121 -0
- package/dist/maps/gl/shaders.d.ts.map +1 -0
- package/dist/maps/gl/shaders.js +453 -0
- package/dist/maps/gl/shaders.js.map +1 -0
- package/dist/maps/gl/store.d.ts +125 -0
- package/dist/maps/gl/store.d.ts.map +1 -0
- package/dist/maps/gl/store.js +512 -0
- package/dist/maps/gl/store.js.map +1 -0
- package/dist/maps/gl/text.d.ts +283 -0
- package/dist/maps/gl/text.d.ts.map +1 -0
- package/dist/maps/gl/text.js +698 -0
- package/dist/maps/gl/text.js.map +1 -0
- package/dist/maps/gl/view.d.ts +345 -0
- package/dist/maps/gl/view.d.ts.map +1 -0
- package/dist/maps/gl/view.js +1209 -0
- package/dist/maps/gl/view.js.map +1 -0
- package/dist/maps/icons.d.ts +32 -0
- package/dist/maps/icons.d.ts.map +1 -0
- package/dist/maps/icons.js +151 -0
- package/dist/maps/icons.js.map +1 -0
- package/dist/maps/index.d.ts +3 -1
- package/dist/maps/index.d.ts.map +1 -1
- package/dist/maps/index.js +218 -52
- package/dist/maps/index.js.map +1 -1
- package/dist/maps/labels.d.ts +91 -18
- package/dist/maps/labels.d.ts.map +1 -1
- package/dist/maps/labels.js +376 -140
- package/dist/maps/labels.js.map +1 -1
- package/dist/maps/node.d.ts +179 -56
- package/dist/maps/node.d.ts.map +1 -1
- package/dist/maps/node.js +663 -537
- 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 +62 -0
- package/dist/maps/proj.d.ts.map +1 -1
- package/dist/maps/proj.js +101 -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 +30 -6
- package/dist/maps/sources.d.ts.map +1 -1
- package/dist/maps/sources.js +22 -3
- package/dist/maps/sources.js.map +1 -1
- package/dist/maps/style.d.ts +35 -0
- package/dist/maps/style.d.ts.map +1 -1
- package/dist/maps/style.js.map +1 -1
- package/dist/maps/styles.d.ts +12 -0
- package/dist/maps/styles.d.ts.map +1 -1
- package/dist/maps/styles.js +120 -6
- package/dist/maps/styles.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 +147 -27
- package/dist/maps/tiles.d.ts.map +1 -1
- package/dist/maps/tiles.js +221 -54
- package/dist/maps/tiles.js.map +1 -1
- package/dist/maps/types.d.ts +213 -21
- 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 +121 -50
- 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/markdown/spans.js +6 -0
- package/dist/markdown/spans.js.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/qml/containers.d.ts.map +1 -1
- package/dist/qml/containers.js +6 -1
- package/dist/qml/containers.js.map +1 -1
- package/dist/qml/interaction.d.ts.map +1 -1
- package/dist/qml/interaction.js +38 -5
- package/dist/qml/interaction.js.map +1 -1
- package/dist/qml/layouts.d.ts.map +1 -1
- package/dist/qml/layouts.js +21 -6
- package/dist/qml/layouts.js.map +1 -1
- package/dist/qml/qtquick.d.ts.map +1 -1
- package/dist/qml/qtquick.js +9 -2
- package/dist/qml/qtquick.js.map +1 -1
- package/dist/qml/react.d.ts.map +1 -1
- package/dist/qml/react.js +9 -7
- package/dist/qml/react.js.map +1 -1
- package/dist/reorder/clock.d.ts +7 -0
- package/dist/reorder/clock.d.ts.map +1 -0
- package/dist/reorder/clock.js +26 -0
- package/dist/reorder/clock.js.map +1 -0
- package/dist/reorder/index.d.ts +25 -3
- package/dist/reorder/index.d.ts.map +1 -1
- package/dist/reorder/index.js +64 -19
- package/dist/reorder/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 +252 -0
- package/dist/rich-text-editor/index.d.ts.map +1 -0
- package/dist/rich-text-editor/index.js +856 -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 +394 -0
- package/dist/rich-text-editor/keymap.js.map +1 -0
- package/dist/rich-text-editor/keys.d.ts +40 -0
- package/dist/rich-text-editor/keys.d.ts.map +1 -0
- package/dist/rich-text-editor/keys.js +202 -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/marks.d.ts +9 -0
- package/dist/rich-text-editor/marks.d.ts.map +1 -0
- package/dist/rich-text-editor/marks.js +83 -0
- package/dist/rich-text-editor/marks.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 +518 -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 +279 -0
- package/dist/rich-text-editor/virtual.js.map +1 -0
- package/dist/richtext/node.d.ts +71 -4
- package/dist/richtext/node.d.ts.map +1 -1
- package/dist/richtext/node.js +233 -28
- package/dist/richtext/node.js.map +1 -1
- package/dist/richtext/runs.d.ts +13 -8
- package/dist/richtext/runs.d.ts.map +1 -1
- package/dist/richtext/runs.js +18 -8
- package/dist/richtext/runs.js.map +1 -1
- package/dist/table/index.d.ts.map +1 -1
- package/dist/table/index.js +23 -0
- package/dist/table/index.js.map +1 -1
- package/dist/table/rows.d.ts +3 -2
- package/dist/table/rows.d.ts.map +1 -1
- package/dist/table/rows.js +20 -6
- package/dist/table/rows.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 +32 -11
- package/dist/terminal/index.js.map +1 -1
- package/dist/terminal/vt/pty.d.ts +13 -2
- package/dist/terminal/vt/pty.d.ts.map +1 -1
- package/dist/terminal/vt/pty.js +18 -3
- package/dist/terminal/vt/pty.js.map +1 -1
- package/dist/terminal-output/index.d.ts.map +1 -1
- package/dist/terminal-output/index.js +6 -1
- package/dist/terminal-output/index.js.map +1 -1
- package/dist/three/canvas.d.ts.map +1 -1
- package/dist/three/canvas.js +85 -7
- package/dist/three/canvas.js.map +1 -1
- package/dist/three/events.d.ts +22 -4
- package/dist/three/events.d.ts.map +1 -1
- package/dist/three/events.js +34 -4
- package/dist/three/events.js.map +1 -1
- package/dist/tree/index.d.ts.map +1 -1
- package/dist/tree/index.js +17 -0
- package/dist/tree/index.js.map +1 -1
- package/package.json +59 -31
- package/src/charts/node.ts +68 -28
- package/src/charts/render.ts +120 -30
- package/src/code/index.ts +3 -1
- package/src/code-editor/completion.ts +3 -2
- package/src/code-editor/index.ts +19 -0
- package/src/code-editor/node.ts +1574 -184
- package/src/code-language/languages/glsl.ts +12 -2
- package/src/code-language/languages/javascript.ts +21 -4
- package/src/code-language/languages/json.ts +12 -2
- package/src/code-language/languages/shell.ts +12 -2
- package/src/code-language/languages/sql.ts +22 -2
- package/src/code-language/stream.ts +257 -17
- package/src/code-language/types.ts +5 -4
- package/src/codeblock/index.ts +20 -3
- package/src/embed/client.ts +102 -8
- package/src/embed/index.ts +2 -0
- package/src/flow/draw.ts +167 -41
- package/src/flow/gl/color.ts +85 -0
- package/src/flow/gl/index.ts +342 -0
- package/src/flow/gl/pack.ts +585 -0
- package/src/flow/gl/renderer.ts +679 -0
- package/src/flow/gl/shaders.ts +371 -0
- package/src/flow/gl/text.ts +1295 -0
- package/src/flow/index.ts +794 -67
- package/src/flow/node.ts +2496 -1256
- package/src/flow/paint.ts +511 -0
- package/src/flow/paths.ts +80 -15
- package/src/flow/scene.ts +2199 -0
- package/src/flow/types.ts +113 -1
- package/src/html/controls.ts +73 -2
- package/src/html/css/calc.ts +385 -0
- package/src/html/css/cascade.ts +1403 -62
- package/src/html/css/color.ts +755 -0
- package/src/html/css/content.ts +417 -0
- package/src/html/css/counter-styles.ts +973 -0
- package/src/html/css/decode.ts +130 -0
- package/src/html/css/parse.ts +1514 -160
- package/src/html/css/style.ts +4102 -222
- package/src/html/css/ua.ts +58 -12
- package/src/html/css/values.ts +150 -50
- package/src/html/css/vars.ts +348 -0
- package/src/html/dom.ts +284 -17
- package/src/html/fonts.ts +641 -0
- package/src/html/gif.ts +233 -0
- package/src/html/index.ts +180 -20
- package/src/html/layout/block.ts +3456 -230
- package/src/html/layout/boxes.ts +2100 -190
- package/src/html/layout/cache.ts +289 -0
- package/src/html/layout/collapse.ts +317 -0
- package/src/html/layout/css-grid.ts +1063 -0
- package/src/html/layout/flex.ts +1115 -106
- package/src/html/layout/floats.ts +128 -14
- package/src/html/layout/grid-lines.ts +141 -0
- package/src/html/layout/grid.ts +181 -0
- package/src/html/layout/inline.ts +3943 -192
- package/src/html/layout/shaping.ts +140 -0
- package/src/html/layout/table.ts +696 -186
- package/src/html/layout/tracks.ts +437 -0
- package/src/html/node.ts +1486 -121
- package/src/html/paint.ts +4293 -169
- package/src/html/resources.ts +161 -50
- package/src/html/surfaces.ts +81 -0
- package/src/html/svg.ts +493 -0
- package/src/html/url.ts +86 -0
- package/src/index.ts +4 -0
- package/src/internal/collate.ts +12 -0
- package/src/{markdown → internal/markdown}/ast.ts +35 -7
- package/src/{markdown → internal/markdown}/parse.ts +288 -35
- package/src/internal/markdown/stringify.ts +772 -0
- package/src/internal/prewarm.ts +45 -0
- package/src/internal/scroll.ts +5 -3
- package/src/internal/sdf.ts +227 -0
- package/src/internal/splice.ts +25 -0
- package/src/internal/window.ts +36 -5
- package/src/maps/anchors.ts +913 -0
- package/src/maps/controller.ts +1084 -0
- package/src/maps/gl/buckets.ts +461 -0
- package/src/maps/gl/build-worker.ts +66 -0
- package/src/maps/gl/color.ts +62 -0
- package/src/maps/gl/cover.ts +205 -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 +968 -0
- package/src/maps/gl/renderer.ts +1660 -0
- package/src/maps/gl/shaders.ts +489 -0
- package/src/maps/gl/store.ts +615 -0
- package/src/maps/gl/text.ts +868 -0
- package/src/maps/gl/view.ts +1489 -0
- package/src/maps/icons.ts +183 -0
- package/src/maps/index.ts +274 -81
- package/src/maps/labels.ts +457 -144
- package/src/maps/node.ts +832 -665
- package/src/maps/overlay.ts +148 -43
- package/src/maps/paint.ts +3 -0
- package/src/maps/proj.ts +118 -0
- package/src/maps/renderer.ts +155 -0
- package/src/maps/sources.ts +43 -6
- package/src/maps/style.ts +32 -0
- package/src/maps/styles.ts +215 -4
- package/src/maps/theme.ts +51 -0
- package/src/maps/tiles.ts +253 -62
- package/src/maps/types.ts +213 -21
- package/src/markdown/expressions.ts +5 -1
- package/src/markdown/index.ts +163 -78
- package/src/markdown/spans.ts +6 -1
- package/src/media-player/index.ts +18 -4
- package/src/qml/containers.tsx +6 -1
- package/src/qml/interaction.tsx +42 -5
- package/src/qml/layouts.tsx +21 -6
- package/src/qml/qtquick.tsx +9 -2
- package/src/qml/react.tsx +7 -5
- package/src/reorder/clock.ts +27 -0
- package/src/reorder/index.ts +100 -27
- 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 +1364 -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 +228 -0
- package/src/rich-text-editor/look.ts +427 -0
- package/src/rich-text-editor/markdown.ts +653 -0
- package/src/rich-text-editor/marks.ts +101 -0
- package/src/rich-text-editor/nodes.ts +497 -0
- package/src/rich-text-editor/render.ts +837 -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 +372 -0
- package/src/richtext/node.ts +294 -44
- package/src/richtext/runs.ts +23 -12
- package/src/table/index.ts +29 -0
- package/src/table/rows.ts +18 -8
- package/src/terminal/backends.ts +4 -1
- package/src/terminal/index.ts +47 -15
- package/src/terminal/vt/pty.ts +16 -2
- package/src/terminal-output/index.ts +6 -1
- package/src/three/canvas.ts +102 -8
- package/src/three/events.ts +49 -9
- package/src/tree/index.ts +19 -0
- 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/src/maps/tiles.ts
CHANGED
|
@@ -18,6 +18,14 @@
|
|
|
18
18
|
// scaled. Only an integer zoom change, a style change or a display-scale
|
|
19
19
|
// change invalidates one.
|
|
20
20
|
//
|
|
21
|
+
// Both are filed under the **source object**, not under its `id`. An id is
|
|
22
|
+
// only what a source is called, and two providers can share one — a source
|
|
23
|
+
// without one is named for its slot in `sources`, and `osmRasterSource` is
|
|
24
|
+
// `osm-raster` whichever server it points at — so filing by id handed a map
|
|
25
|
+
// switched to another provider the old one's tiles wherever it had them,
|
|
26
|
+
// until eviction got round to them. Filed by object, a new provider starts
|
|
27
|
+
// empty, and an old one keeps its tiles for when it comes back.
|
|
28
|
+
//
|
|
21
29
|
// The surface is the expensive half — on the corpus in `scripts/bench/`, a
|
|
22
30
|
// dense city tile is 50-140 ms to rasterize and about 0.05 ms to composite
|
|
23
31
|
// — so the cache's job is to make sure that cost is paid once per tile per
|
|
@@ -25,8 +33,8 @@
|
|
|
25
33
|
import type { PreparedStyle } from './paint.js';
|
|
26
34
|
import type { VectorTile } from './mvt.js';
|
|
27
35
|
import { parseTile } from './mvt.js';
|
|
28
|
-
import { tileKey } from './proj.js';
|
|
29
|
-
import type { TileId } from './proj.js';
|
|
36
|
+
import { BELOW, FILL_DEPTH, fillFromBelow, tileKey } from './proj.js';
|
|
37
|
+
import type { TileCell, TileId } from './proj.js';
|
|
30
38
|
import { pyramidOf } from './sources.js';
|
|
31
39
|
import type { MapSource, TileData } from './sources.js';
|
|
32
40
|
|
|
@@ -80,6 +88,14 @@ export interface TileRender {
|
|
|
80
88
|
zoom: number;
|
|
81
89
|
/** The cache generation it was drawn under. */
|
|
82
90
|
generation: number;
|
|
91
|
+
/**
|
|
92
|
+
* Whether its pixels depend on the style. A vector tile's do — they are
|
|
93
|
+
* the style, rasterized — and a raster tile's do not: they are the
|
|
94
|
+
* provider's image, uploaded as it arrived. So an unstyled rendering
|
|
95
|
+
* belongs to every generation, and a restyle neither redraws it nor stops
|
|
96
|
+
* showing it.
|
|
97
|
+
*/
|
|
98
|
+
styled: boolean;
|
|
83
99
|
/** The next style run to draw, or `-1` when it is finished. */
|
|
84
100
|
progress: number;
|
|
85
101
|
/** …and how far into that run's active layers, because a run is not a
|
|
@@ -97,6 +113,12 @@ export interface TileRender {
|
|
|
97
113
|
*/
|
|
98
114
|
export interface TileDataEntry {
|
|
99
115
|
readonly key: string;
|
|
116
|
+
/** Who answers for it — and so which provider the bytes came from,
|
|
117
|
+
* since tiles are filed under the source object. */
|
|
118
|
+
readonly source: MapSource;
|
|
119
|
+
/** What that source is called: the `sourceId` its `load` requests carry
|
|
120
|
+
* and `onError` reports. */
|
|
121
|
+
readonly sourceId: string;
|
|
100
122
|
readonly tile: TileId;
|
|
101
123
|
status: TileStatus;
|
|
102
124
|
error: unknown;
|
|
@@ -141,7 +163,15 @@ export class CachedTile {
|
|
|
141
163
|
* keeps being composited until it is ready to be replaced.
|
|
142
164
|
*/
|
|
143
165
|
shown: TileRender | null = null;
|
|
144
|
-
/**
|
|
166
|
+
/**
|
|
167
|
+
* The rendering being drawn, or null when there is nothing to draw.
|
|
168
|
+
*
|
|
169
|
+
* Finished ones do not usually stay: a draft is {@link TileCache.promote}d
|
|
170
|
+
* in the frame it is done. The exception is a restyle, which holds the
|
|
171
|
+
* previous style's whole picture up until the view is redrawn — so there
|
|
172
|
+
* a finished draft waits here until {@link TileCache.swap} puts every one
|
|
173
|
+
* on screen at once.
|
|
174
|
+
*/
|
|
145
175
|
drawing: TileRender | null = null;
|
|
146
176
|
/** Frame counter of the last frame that wanted it — what eviction sorts
|
|
147
177
|
* on. */
|
|
@@ -207,12 +237,20 @@ export class TileCache {
|
|
|
207
237
|
private readonly _entries = new Map<string, CachedTile>();
|
|
208
238
|
/** The source's own tiles, shared by every rendering that draws one. */
|
|
209
239
|
private readonly _data = new Map<string, TileDataEntry>();
|
|
240
|
+
/** The key prefix of each source object — per object and not per id,
|
|
241
|
+
* for the reason at the top of this file. */
|
|
242
|
+
private readonly _prefixes = new WeakMap<MapSource, string>();
|
|
243
|
+
private _prefixCount = 0;
|
|
210
244
|
private readonly _options: TileCacheOptions;
|
|
211
245
|
private _frame = 0;
|
|
212
246
|
private _surfaceBytes = 0;
|
|
213
247
|
/** Bumped by a style change, which retires every surface without
|
|
214
248
|
* touching the data behind it. */
|
|
215
249
|
private _generation = 0;
|
|
250
|
+
/** The key of every tile with a picture, and of its ancestors up to
|
|
251
|
+
* `FILL_DEPTH` levels above it — see {@link descendantsWithSurface}.
|
|
252
|
+
* Built when first asked, and dropped whenever a picture comes or goes. */
|
|
253
|
+
private _below: Set<string> | null = null;
|
|
216
254
|
|
|
217
255
|
constructor(options: TileCacheOptions = {}) {
|
|
218
256
|
this._options = options;
|
|
@@ -227,7 +265,16 @@ export class TileCache {
|
|
|
227
265
|
return this._generation;
|
|
228
266
|
}
|
|
229
267
|
|
|
230
|
-
/**
|
|
268
|
+
/**
|
|
269
|
+
* Every styled surface is stale: a new style, or `refresh()` after an
|
|
270
|
+
* edit to one. The data behind them stays, and so does a raster tile's
|
|
271
|
+
* rendering, which no style drew (see {@link TileRender.styled}).
|
|
272
|
+
*
|
|
273
|
+
* A new display scale needs none of this, because a rendering's size is
|
|
274
|
+
* already part of what makes it valid. And nothing on screen is thrown
|
|
275
|
+
* away here: each picture stays until its replacement is finished —
|
|
276
|
+
* {@link promote} for one tile, {@link swap} for the whole view at once.
|
|
277
|
+
*/
|
|
231
278
|
invalidateStyle(): void {
|
|
232
279
|
this._generation++;
|
|
233
280
|
}
|
|
@@ -241,21 +288,31 @@ export class TileCache {
|
|
|
241
288
|
return this._entries.size;
|
|
242
289
|
}
|
|
243
290
|
|
|
244
|
-
|
|
245
|
-
|
|
291
|
+
/** What a source's tile is filed under: a prefix of the source object's
|
|
292
|
+
* own, then `z/x/y`. The id is in the prefix only so that a key reads
|
|
293
|
+
* well in a debugger; two objects with one id get two prefixes. */
|
|
294
|
+
key(source: MapSource, tile: TileId): string {
|
|
295
|
+
let prefix = this._prefixes.get(source);
|
|
296
|
+
if (prefix === undefined) {
|
|
297
|
+
prefix = `${source.id ?? 'source'}#${++this._prefixCount}`;
|
|
298
|
+
this._prefixes.set(source, prefix);
|
|
299
|
+
}
|
|
300
|
+
return `${prefix}:${tileKey(tile)}`;
|
|
246
301
|
}
|
|
247
302
|
|
|
248
|
-
peek(
|
|
249
|
-
return this._entries.get(this.key(
|
|
303
|
+
peek(source: MapSource, tile: TileId): CachedTile | undefined {
|
|
304
|
+
return this._entries.get(this.key(source, tile));
|
|
250
305
|
}
|
|
251
306
|
|
|
252
307
|
/**
|
|
253
308
|
* The entry for a tile the cover asked for, and the data behind it,
|
|
254
309
|
* asking the source for that data if nothing has yet.
|
|
255
310
|
*
|
|
256
|
-
* `
|
|
257
|
-
*
|
|
258
|
-
*
|
|
311
|
+
* Filed under `source`; `sourceId` is only what it is called. `dataTile`
|
|
312
|
+
* is the tile whose bytes serve this one — itself, until the cover goes
|
|
313
|
+
* deeper than the source cuts. Marks both used by the current frame,
|
|
314
|
+
* which is what keeps them out of the next eviction — and a load still
|
|
315
|
+
* in flight from being cancelled by {@link sweep}.
|
|
259
316
|
*/
|
|
260
317
|
want(
|
|
261
318
|
source: MapSource,
|
|
@@ -265,7 +322,7 @@ export class TileCache {
|
|
|
265
322
|
sub: { x: number; y: number; span: number } = { x: 0, y: 0, span: 1 },
|
|
266
323
|
): CachedTile {
|
|
267
324
|
const data = this._wantData(source, sourceId, dataTile);
|
|
268
|
-
const key = this.key(
|
|
325
|
+
const key = this.key(source, tile);
|
|
269
326
|
let entry = this._entries.get(key);
|
|
270
327
|
if (!entry) {
|
|
271
328
|
entry = new CachedTile(key, sourceId, tile, data, sub);
|
|
@@ -280,11 +337,13 @@ export class TileCache {
|
|
|
280
337
|
sourceId: string,
|
|
281
338
|
tile: TileId,
|
|
282
339
|
): TileDataEntry {
|
|
283
|
-
const key = this.key(
|
|
340
|
+
const key = this.key(source, tile);
|
|
284
341
|
let data = this._data.get(key);
|
|
285
342
|
if (!data) {
|
|
286
343
|
data = {
|
|
287
344
|
key,
|
|
345
|
+
source,
|
|
346
|
+
sourceId,
|
|
288
347
|
tile,
|
|
289
348
|
status: 'idle',
|
|
290
349
|
error: null,
|
|
@@ -299,23 +358,19 @@ export class TileCache {
|
|
|
299
358
|
}
|
|
300
359
|
data.lastUsed = this._frame;
|
|
301
360
|
if (data.status === 'idle') {
|
|
302
|
-
this._load(
|
|
361
|
+
this._load(data);
|
|
303
362
|
} else if (data.status === 'error' && Date.now() >= data.retryAt) {
|
|
304
363
|
// A failed tile is retried, but on a backoff rather than on every
|
|
305
364
|
// frame. Without it a source that is down — or an application whose
|
|
306
365
|
// `load` throws on the first call, which is how this was found — is
|
|
307
366
|
// asked for every visible tile sixty times a second, which is a
|
|
308
367
|
// retry storm pointed at somebody else's servers.
|
|
309
|
-
this._load(
|
|
368
|
+
this._load(data);
|
|
310
369
|
}
|
|
311
370
|
return data;
|
|
312
371
|
}
|
|
313
372
|
|
|
314
|
-
private _load(
|
|
315
|
-
source: MapSource,
|
|
316
|
-
sourceId: string,
|
|
317
|
-
entry: TileDataEntry,
|
|
318
|
-
): void {
|
|
373
|
+
private _load(entry: TileDataEntry): void {
|
|
319
374
|
entry.status = 'loading';
|
|
320
375
|
entry.error = null;
|
|
321
376
|
// A **real** `AbortController` where the runtime has one. A look-alike
|
|
@@ -365,7 +420,11 @@ export class TileCache {
|
|
|
365
420
|
};
|
|
366
421
|
let result: TileData | Promise<TileData>;
|
|
367
422
|
try {
|
|
368
|
-
result = source.load({
|
|
423
|
+
result = entry.source.load({
|
|
424
|
+
...entry.tile,
|
|
425
|
+
sourceId: entry.sourceId,
|
|
426
|
+
signal,
|
|
427
|
+
});
|
|
369
428
|
} catch (error) {
|
|
370
429
|
settle(() => fail(error));
|
|
371
430
|
return;
|
|
@@ -408,20 +467,24 @@ export class TileCache {
|
|
|
408
467
|
* under the fine one until it arrives — which is the difference between a
|
|
409
468
|
* map that fills in and a map that flashes empty. Bounded, because
|
|
410
469
|
* scaling one tile over sixteen screenfuls is worse than the hole.
|
|
470
|
+
*
|
|
471
|
+
* With a `generation`, only a picture drawn in it counts: a map showing
|
|
472
|
+
* one style must not cover a hole with a tile drawn in another.
|
|
411
473
|
*/
|
|
412
474
|
ancestorWithSurface(
|
|
413
|
-
|
|
475
|
+
source: MapSource,
|
|
414
476
|
tile: TileId,
|
|
415
477
|
levels = 5,
|
|
478
|
+
generation?: number,
|
|
416
479
|
): CachedTile | null {
|
|
417
480
|
let z = tile.z - 1;
|
|
418
481
|
let x = tile.x >> 1;
|
|
419
482
|
let y = tile.y >> 1;
|
|
420
483
|
for (let up = 0; up < levels && z >= 0; up++, z--, x >>= 1, y >>= 1) {
|
|
421
|
-
const entry = this._entries.get(this.key(
|
|
484
|
+
const entry = this._entries.get(this.key(source, { z, x, y }));
|
|
422
485
|
// `shown` is finished by construction, so an ancestor is never a
|
|
423
486
|
// half-drawn picture.
|
|
424
|
-
if (entry?.shown) {
|
|
487
|
+
if (entry?.shown && drawnFor(entry.shown, generation)) {
|
|
425
488
|
// Stamped, because for as long as it is covering a hole it is on
|
|
426
489
|
// screen — and an unstamped entry is the *first* thing eviction
|
|
427
490
|
// takes, which would drop the only picture the map is showing.
|
|
@@ -433,7 +496,8 @@ export class TileCache {
|
|
|
433
496
|
}
|
|
434
497
|
|
|
435
498
|
/**
|
|
436
|
-
* The finished **descendants** of a tile,
|
|
499
|
+
* The finished **descendants** of a tile, where each sits inside it, and
|
|
500
|
+
* the gaps they leave.
|
|
437
501
|
*
|
|
438
502
|
* The mirror of {@link ancestorWithSurface}, and the half a map needs
|
|
439
503
|
* when it zooms *out*: the tiles already in hand are then the target's
|
|
@@ -442,39 +506,64 @@ export class TileCache {
|
|
|
442
506
|
* over it, which is exactly as odd as it sounds — until the coarser tile
|
|
443
507
|
* has been fetched, rasterized and composited.
|
|
444
508
|
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
*
|
|
509
|
+
* Each quarter of the square is taken from the nearest level that has it,
|
|
510
|
+
* down to `FILL_DEPTH` — see `fillFromBelow`. The first cut took one
|
|
511
|
+
* level for the whole square, the nearest with anything in it, and looked
|
|
512
|
+
* two down. Both left the view blank where a zoom out needs it most: the
|
|
513
|
+
* edges, where the level the map came from covers only part of a coarser
|
|
514
|
+
* tile and the rest is one level further down or nowhere; and a zoom out
|
|
515
|
+
* of more than two levels, which a flick of the wheel is.
|
|
516
|
+
*
|
|
517
|
+
* The search goes only where {@link _heldBelow} says there is something,
|
|
518
|
+
* so a hole with nothing under it — every tile of a zoom *in* — costs four
|
|
519
|
+
* lookups rather than three hundred.
|
|
520
|
+
*
|
|
521
|
+
* `generation` as for {@link ancestorWithSurface}.
|
|
448
522
|
*/
|
|
449
523
|
descendantsWithSurface(
|
|
450
|
-
|
|
524
|
+
source: MapSource,
|
|
451
525
|
tile: TileId,
|
|
452
|
-
|
|
453
|
-
): {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
526
|
+
generation?: number,
|
|
527
|
+
): {
|
|
528
|
+
pieces: (TileCell & { tile: TileId; value: CachedTile })[];
|
|
529
|
+
gaps: TileCell[];
|
|
530
|
+
} {
|
|
531
|
+
const below = this._heldBelow();
|
|
532
|
+
const { pieces, gaps } = fillFromBelow(tile, FILL_DEPTH, (under) => {
|
|
533
|
+
const key = this.key(source, under);
|
|
534
|
+
if (!below.has(key)) return undefined;
|
|
535
|
+
const entry = this._entries.get(key);
|
|
536
|
+
if (entry?.shown && drawnFor(entry.shown, generation)) {
|
|
537
|
+
// Stamped, for the reason `ancestorWithSurface` gives.
|
|
538
|
+
entry.lastUsed = this._frame;
|
|
539
|
+
return entry;
|
|
540
|
+
}
|
|
541
|
+
return BELOW;
|
|
542
|
+
});
|
|
543
|
+
return { pieces, gaps };
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/** The keys of every tile with a picture and of its ancestors up to
|
|
547
|
+
* `FILL_DEPTH` levels above — so a search under a hole can tell where
|
|
548
|
+
* there is nothing without asking for each tile there. A superset where
|
|
549
|
+
* a picture is of another generation, which only costs the search a
|
|
550
|
+
* level. */
|
|
551
|
+
private _heldBelow(): Set<string> {
|
|
552
|
+
if (this._below) return this._below;
|
|
553
|
+
const below = new Set<string>();
|
|
554
|
+
for (const entry of this._entries.values()) {
|
|
555
|
+
if (!entry.shown) continue;
|
|
556
|
+
below.add(entry.key);
|
|
557
|
+
let { z, x, y } = entry.tile;
|
|
558
|
+
for (let up = 1; up <= FILL_DEPTH && z > 0; up++) {
|
|
559
|
+
z--;
|
|
560
|
+
x >>= 1;
|
|
561
|
+
y >>= 1;
|
|
562
|
+
below.add(this.key(entry.data.source, { z, x, y }));
|
|
472
563
|
}
|
|
473
|
-
// The nearest level that has anything wins: one level down is both
|
|
474
|
-
// the sharpest and the fewest composites.
|
|
475
|
-
if (found.length > 0) return found;
|
|
476
564
|
}
|
|
477
|
-
|
|
565
|
+
this._below = below;
|
|
566
|
+
return below;
|
|
478
567
|
}
|
|
479
568
|
|
|
480
569
|
/**
|
|
@@ -493,12 +582,19 @@ export class TileCache {
|
|
|
493
582
|
* the tile is blank for the several frames it takes to redraw, which
|
|
494
583
|
* above a source's `maxZoom` happens at every integer zoom — the same
|
|
495
584
|
* z14 tile serves 15, 16, 17 and on.
|
|
585
|
+
*
|
|
586
|
+
* A draft that is finished but not yet promoted — a restyle holding the
|
|
587
|
+
* old style up until the whole view is ready — matches like any other and
|
|
588
|
+
* comes back as it is, so it is not drawn twice.
|
|
496
589
|
*/
|
|
497
590
|
beginRender(
|
|
498
591
|
entry: CachedTile,
|
|
499
592
|
size: number,
|
|
500
593
|
zoom: number,
|
|
501
594
|
make: SurfaceFactory,
|
|
595
|
+
/** False for a raster tile, whose pixels are the provider's and no
|
|
596
|
+
* style's — see {@link TileRender.styled}. */
|
|
597
|
+
styled = true,
|
|
502
598
|
): TileRender | null {
|
|
503
599
|
if (this._matches(entry.shown, size, zoom)) return null;
|
|
504
600
|
if (this._matches(entry.drawing, size, zoom)) return entry.drawing;
|
|
@@ -515,6 +611,7 @@ export class TileCache {
|
|
|
515
611
|
size,
|
|
516
612
|
zoom,
|
|
517
613
|
generation: this._generation,
|
|
614
|
+
styled,
|
|
518
615
|
progress: 0,
|
|
519
616
|
progressLayer: 0,
|
|
520
617
|
};
|
|
@@ -530,7 +627,7 @@ export class TileCache {
|
|
|
530
627
|
render !== null &&
|
|
531
628
|
render.size === size &&
|
|
532
629
|
render.zoom === zoom &&
|
|
533
|
-
render
|
|
630
|
+
drawnFor(render, this._generation)
|
|
534
631
|
);
|
|
535
632
|
}
|
|
536
633
|
|
|
@@ -542,9 +639,38 @@ export class TileCache {
|
|
|
542
639
|
if (entry.shown) this._release(entry.shown);
|
|
543
640
|
entry.shown = entry.drawing;
|
|
544
641
|
entry.drawing = null;
|
|
642
|
+
this._below = null;
|
|
545
643
|
return true;
|
|
546
644
|
}
|
|
547
645
|
|
|
646
|
+
/**
|
|
647
|
+
* Put the current generation on screen in one go: every finished draft
|
|
648
|
+
* becomes its tile's picture, and every picture and draft of an earlier
|
|
649
|
+
* generation is released — apart from a raster tile's, which no style
|
|
650
|
+
* drew.
|
|
651
|
+
*
|
|
652
|
+
* The other half of a restyle. While the element holds the previous style
|
|
653
|
+
* up it does not {@link promote}, so finished drafts wait in `drawing`,
|
|
654
|
+
* and this is the frame they all land in. What is released is more than
|
|
655
|
+
* what they replace: a tile off screen still holds whatever it was last
|
|
656
|
+
* drawn in, which is now a picture of a style the map has left — never
|
|
657
|
+
* composited again, and otherwise kept until eviction got round to it.
|
|
658
|
+
*/
|
|
659
|
+
swap(): void {
|
|
660
|
+
this._below = null;
|
|
661
|
+
for (const entry of this._entries.values()) {
|
|
662
|
+
if (entry.drawing && !drawnFor(entry.drawing, this._generation)) {
|
|
663
|
+
this._release(entry.drawing);
|
|
664
|
+
entry.drawing = null;
|
|
665
|
+
}
|
|
666
|
+
if (this.promote(entry)) continue;
|
|
667
|
+
if (entry.shown && !drawnFor(entry.shown, this._generation)) {
|
|
668
|
+
this._release(entry.shown);
|
|
669
|
+
entry.shown = null;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
|
|
548
674
|
/** Note where a tile's rasterization stopped: at run `run`, having
|
|
549
675
|
* finished `layer` of its active layers (`-1` for all of them). */
|
|
550
676
|
advance(
|
|
@@ -558,14 +684,18 @@ export class TileCache {
|
|
|
558
684
|
}
|
|
559
685
|
|
|
560
686
|
/**
|
|
561
|
-
* Drop what is no longer worth keeping.
|
|
687
|
+
* Drop what is no longer worth keeping. Called once a frame, after every
|
|
688
|
+
* tile the frame still needs has been through {@link want}.
|
|
562
689
|
*
|
|
563
|
-
*
|
|
690
|
+
* A load the frame did not want is cancelled outright (see
|
|
691
|
+
* `_cancelUnwanted`). What has arrived is kept on budgets instead:
|
|
692
|
+
* surfaces first and by least-recently-wanted, because they are two
|
|
564
693
|
* orders of magnitude larger than the data behind them and much cheaper
|
|
565
|
-
* to lose
|
|
566
|
-
* network request.
|
|
694
|
+
* to lose — a dropped surface is one re-rasterization, a dropped tile is
|
|
695
|
+
* a network request.
|
|
567
696
|
*/
|
|
568
697
|
sweep(): void {
|
|
698
|
+
this._cancelUnwanted();
|
|
569
699
|
if (
|
|
570
700
|
this._surfaceBytes >
|
|
571
701
|
(this._options.surfaceBudget ?? DEFAULT_SURFACE_BUDGET)
|
|
@@ -605,8 +735,50 @@ export class TileCache {
|
|
|
605
735
|
}
|
|
606
736
|
}
|
|
607
737
|
|
|
738
|
+
/**
|
|
739
|
+
* Cancel every load the frame just drawn did not ask for.
|
|
740
|
+
*
|
|
741
|
+
* A tile panned or zoomed out of the cover — or every tile of a source
|
|
742
|
+
* taken out of `sources` — would otherwise load to the end: a request
|
|
743
|
+
* nobody is waiting for, then a full-pane repaint when it lands, because
|
|
744
|
+
* a landing tile is an `onChange`. The cover is padded, so a tile just off
|
|
745
|
+
* screen is still wanted and keeps loading. That is also the contract on
|
|
746
|
+
* the element: it wants the whole cover on every frame, clipped and
|
|
747
|
+
* mid-gesture ones included, or what it skipped is aborted here and
|
|
748
|
+
* fetched again.
|
|
749
|
+
*
|
|
750
|
+
* Only loads: data that has arrived stays on the budgets above, and is
|
|
751
|
+
* what makes panning back, or switching back to a provider, free.
|
|
752
|
+
*
|
|
753
|
+
* And forgotten rather than parked. An aborted load never settles
|
|
754
|
+
* (`settle` ignores it), so an entry left in `_data` would say `'loading'`
|
|
755
|
+
* forever and never be asked for again; its renderings go with it, since
|
|
756
|
+
* each reads through to the same entry for life, and none has a surface to
|
|
757
|
+
* lose. The next frame that wants the tile starts over, with a new request
|
|
758
|
+
* and a new signal.
|
|
759
|
+
*/
|
|
760
|
+
private _cancelUnwanted(): void {
|
|
761
|
+
let unwanted: Set<TileDataEntry> | null = null;
|
|
762
|
+
for (const data of this._data.values()) {
|
|
763
|
+
if (data.status === 'loading' && data.lastUsed < this._frame) {
|
|
764
|
+
(unwanted ??= new Set<TileDataEntry>()).add(data);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
if (!unwanted) return;
|
|
768
|
+
for (const entry of [...this._entries.values()]) {
|
|
769
|
+
if (unwanted.has(entry.data)) this._drop(entry);
|
|
770
|
+
}
|
|
771
|
+
for (const data of unwanted) {
|
|
772
|
+
data.abort?.();
|
|
773
|
+
this._data.delete(data.key);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
|
|
608
777
|
private _dropSurface(entry: CachedTile): void {
|
|
609
|
-
if (entry.shown)
|
|
778
|
+
if (entry.shown) {
|
|
779
|
+
this._release(entry.shown);
|
|
780
|
+
this._below = null;
|
|
781
|
+
}
|
|
610
782
|
if (entry.drawing) this._release(entry.drawing);
|
|
611
783
|
entry.shown = null;
|
|
612
784
|
entry.drawing = null;
|
|
@@ -640,6 +812,7 @@ export class TileCache {
|
|
|
640
812
|
for (const data of this._data.values()) data.abort?.();
|
|
641
813
|
this._data.clear();
|
|
642
814
|
this._surfaceBytes = 0;
|
|
815
|
+
this._below = null;
|
|
643
816
|
}
|
|
644
817
|
|
|
645
818
|
/** Every entry — for a test, and for the `onTiles` diagnostic. */
|
|
@@ -647,14 +820,32 @@ export class TileCache {
|
|
|
647
820
|
return this._entries.values();
|
|
648
821
|
}
|
|
649
822
|
|
|
650
|
-
/** Every source tile whose bytes are held
|
|
651
|
-
*
|
|
652
|
-
* source
|
|
823
|
+
/** Every source tile whose bytes are held — including those of sources no
|
|
824
|
+
* longer on the map, which is what makes switching back free and why a
|
|
825
|
+
* reader filters on `source`. What labels are collected from: a label
|
|
826
|
+
* belongs to the tile the data came from, and past a source's depth many
|
|
827
|
+
* renderings share one of those. */
|
|
653
828
|
dataEntries(): IterableIterator<TileDataEntry> {
|
|
654
829
|
return this._data.values();
|
|
655
830
|
}
|
|
656
831
|
}
|
|
657
832
|
|
|
833
|
+
/**
|
|
834
|
+
* Whether a rendering can be shown for `generation`: any can when none is
|
|
835
|
+
* given, which is `progressive`; one no style drew — a raster tile's — can
|
|
836
|
+
* in every generation; any other only in the one it was drawn under.
|
|
837
|
+
*/
|
|
838
|
+
export function drawnFor(
|
|
839
|
+
render: TileRender,
|
|
840
|
+
generation: number | undefined,
|
|
841
|
+
): boolean {
|
|
842
|
+
return (
|
|
843
|
+
generation === undefined ||
|
|
844
|
+
!render.styled ||
|
|
845
|
+
render.generation === generation
|
|
846
|
+
);
|
|
847
|
+
}
|
|
848
|
+
|
|
658
849
|
/** A source's pyramid, memoized per source object so the defaults are not
|
|
659
850
|
* refilled per frame. */
|
|
660
851
|
const pyramids = new WeakMap<
|