@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
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
// Text layouts kept from one layout pass to the next, by what they lay out.
|
|
2
|
+
//
|
|
3
|
+
// An edit runs the whole pipeline again — parse, cascade, boxes, layout —
|
|
4
|
+
// because an HTML document is one string and any character of it can change
|
|
5
|
+
// any box. Most of a pass over a long document was the text engine laying
|
|
6
|
+
// every paragraph out again: three quarters of an edit to 600 KB, identical
|
|
7
|
+
// to the last time for all but the paragraph that changed.
|
|
8
|
+
//
|
|
9
|
+
// So a layout is kept with what went into it — the runs' text and styles,
|
|
10
|
+
// the block's style and the options — and a pass that asks for the same
|
|
11
|
+
// again gets the same layout back. Nothing a layout is found by names a box or
|
|
12
|
+
// an element, which is what makes it survive a re-parse: the runs carry no
|
|
13
|
+
// element (hit testing finds a run's element through the document's text
|
|
14
|
+
// index, `LineText.spans`), so a layout says nothing about which parse it
|
|
15
|
+
// was made for.
|
|
16
|
+
//
|
|
17
|
+
// Two generations bound it: a pass may take what the pass before used, and
|
|
18
|
+
// what neither used is dropped. A long document costs one pass's layouts
|
|
19
|
+
// and the layouts an edit replaced, never the history of every edit.
|
|
20
|
+
import type { TextRun } from '../../richtext/index.js';
|
|
21
|
+
import type { TextLayoutLike } from './boxes.js';
|
|
22
|
+
import type { FontsLike } from './inline.js';
|
|
23
|
+
|
|
24
|
+
export class TextLayoutCache {
|
|
25
|
+
/** The fonts to lay out with: the engine's, answered from here when a
|
|
26
|
+
* layout is already on hand. One object for the cache's life, since the
|
|
27
|
+
* measurements keyed on the fonts (a space's advance) are kept per
|
|
28
|
+
* object. */
|
|
29
|
+
readonly fonts: FontsLike;
|
|
30
|
+
private _now = new Map<number, Kept[]>();
|
|
31
|
+
private _before = new Map<number, Kept[]>();
|
|
32
|
+
/** Each layout handed out, and what it was made from (`inputsOf`). */
|
|
33
|
+
private _inputs = new WeakMap<TextLayoutLike, Kept>();
|
|
34
|
+
|
|
35
|
+
constructor(readonly engine: FontsLike) {
|
|
36
|
+
this.fonts = {
|
|
37
|
+
layout: (content, style, options) =>
|
|
38
|
+
this._layout(content, style, options),
|
|
39
|
+
match: (family, style) => engine.match(family, style),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** A pass is starting: what the last one used, this one may reuse. */
|
|
44
|
+
begin(): void {
|
|
45
|
+
this._before = this._now;
|
|
46
|
+
this._now = new Map();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The layout for these inputs: one this pass has already made or used,
|
|
51
|
+
* else one the pass before used, else the engine's.
|
|
52
|
+
*
|
|
53
|
+
* A layout is filed under a hash of its width and a summary of its text
|
|
54
|
+
* (`keyOf`), and found by comparing everything it was made from, field by
|
|
55
|
+
* field, text and all. The first version spelled all of it into one
|
|
56
|
+
* string key, every field of every run, and that string was the cost: a
|
|
57
|
+
* pass over a 600 KB document asks for 8,800 layouts of 15,400 runs. The
|
|
58
|
+
* text alone as the key was still the whole document built, flattened and
|
|
59
|
+
* hashed a pass, and even a summary spelled as a string was one to build
|
|
60
|
+
* and hash for every layout; the comparison that finds the layout reads
|
|
61
|
+
* the text once.
|
|
62
|
+
*/
|
|
63
|
+
private _layout(
|
|
64
|
+
content: TextRun[],
|
|
65
|
+
style: Record<string, unknown>,
|
|
66
|
+
options: Parameters<FontsLike['layout']>[2],
|
|
67
|
+
): TextLayoutLike {
|
|
68
|
+
const key = keyOf(content, options.maxWidth);
|
|
69
|
+
const now = this._now.get(key);
|
|
70
|
+
let kept = now && find(now, content, style, options);
|
|
71
|
+
if (kept) return kept.layout;
|
|
72
|
+
kept = find(this._before.get(key), content, style, options) ?? {
|
|
73
|
+
// copies, so that nothing done to the inputs afterwards can change
|
|
74
|
+
// what this layout is found by
|
|
75
|
+
content: content.map((run) => ({ ...run })),
|
|
76
|
+
style: { ...style },
|
|
77
|
+
options: { ...options },
|
|
78
|
+
layout: this.engine.layout(content, style, options),
|
|
79
|
+
};
|
|
80
|
+
if (now) now.push(kept);
|
|
81
|
+
else this._now.set(key, [kept]);
|
|
82
|
+
this._inputs.set(kept.layout, kept);
|
|
83
|
+
return kept.layout;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* What a layout this cache handed out was made from — its runs, the
|
|
88
|
+
* block's style and the options, copies all — or undefined for one it
|
|
89
|
+
* did not. A pointer move that changes only a paragraph's ink lays the
|
|
90
|
+
* same text out again with the new ink from these, where the pass would
|
|
91
|
+
* have laid out the document (`HtmlViewNode._hoverInPlace`).
|
|
92
|
+
*/
|
|
93
|
+
inputsOf(layout: TextLayoutLike):
|
|
94
|
+
| {
|
|
95
|
+
readonly content: readonly TextRun[];
|
|
96
|
+
readonly style: Record<string, unknown>;
|
|
97
|
+
readonly options: Options;
|
|
98
|
+
}
|
|
99
|
+
| undefined {
|
|
100
|
+
return this._inputs.get(layout);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** How many characters of a text's start and of its end go into its key. */
|
|
105
|
+
const KEY_EDGE = 16;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* What a layout is filed under: a hash of its width, its runs' count, its
|
|
109
|
+
* text's length, and the text's first and last few characters, small
|
|
110
|
+
* enough to stay a small integer. Paragraphs that share all of that, or
|
|
111
|
+
* whose hashes meet, are told apart by `find`; a key of the whole text was
|
|
112
|
+
* the text copied and hashed for every layout of every pass.
|
|
113
|
+
*/
|
|
114
|
+
function keyOf(content: readonly TextRun[], maxWidth: unknown): number {
|
|
115
|
+
let length = 0;
|
|
116
|
+
for (const run of content) length += run.text.length;
|
|
117
|
+
let h = Math.imul(content.length ^ length, 0x9e3779b1);
|
|
118
|
+
if (typeof maxWidth === 'number') {
|
|
119
|
+
h = Math.imul(h ^ Math.round(maxWidth * 64), 0x85ebca6b);
|
|
120
|
+
}
|
|
121
|
+
let n = 0;
|
|
122
|
+
for (let i = 0; i < content.length && n < KEY_EDGE; i += 1) {
|
|
123
|
+
const text = content[i].text;
|
|
124
|
+
for (let j = 0; j < text.length && n < KEY_EDGE; j += 1, n += 1) {
|
|
125
|
+
h = Math.imul(h ^ text.charCodeAt(j), 0x01000193);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
n = 0;
|
|
129
|
+
for (let i = content.length - 1; i >= 0 && n < KEY_EDGE; i -= 1) {
|
|
130
|
+
const text = content[i].text;
|
|
131
|
+
for (let j = text.length - 1; j >= 0 && n < KEY_EDGE; j -= 1, n += 1) {
|
|
132
|
+
h = Math.imul(h ^ text.charCodeAt(j), 0x01000193);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return h & 0x3fffffff;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
type Options = Parameters<FontsLike['layout']>[2];
|
|
139
|
+
|
|
140
|
+
/** A layout, and a copy of everything it was made from. */
|
|
141
|
+
interface Kept {
|
|
142
|
+
content: TextRun[];
|
|
143
|
+
style: Record<string, unknown>;
|
|
144
|
+
options: Options;
|
|
145
|
+
layout: TextLayoutLike;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** The layout among `kept` made from exactly these inputs. */
|
|
149
|
+
function find(
|
|
150
|
+
kept: Kept[] | undefined,
|
|
151
|
+
content: readonly TextRun[],
|
|
152
|
+
style: Record<string, unknown>,
|
|
153
|
+
options: Options,
|
|
154
|
+
): Kept | undefined {
|
|
155
|
+
if (!kept) return undefined;
|
|
156
|
+
outer: for (const candidate of kept) {
|
|
157
|
+
if (candidate.content.length !== content.length) continue;
|
|
158
|
+
if (!sameOptions(candidate.options, options)) continue;
|
|
159
|
+
if (!sameStyle(candidate.style, style)) continue;
|
|
160
|
+
for (let i = 0; i < content.length; i += 1) {
|
|
161
|
+
if (!sameRun(candidate.content[i], content[i])) continue outer;
|
|
162
|
+
}
|
|
163
|
+
return candidate;
|
|
164
|
+
}
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Every field of a run: two runs are the same run when these are. Checked
|
|
170
|
+
* against `TextRun` by the compiler, so a field added there cannot be left
|
|
171
|
+
* out of the list, and `sameRun` compares each of them, which a test holds
|
|
172
|
+
* it to.
|
|
173
|
+
*/
|
|
174
|
+
export const RUN_FIELDS = [
|
|
175
|
+
'text',
|
|
176
|
+
'family',
|
|
177
|
+
'size',
|
|
178
|
+
'weight',
|
|
179
|
+
'style',
|
|
180
|
+
'color',
|
|
181
|
+
'letterSpacing',
|
|
182
|
+
'bg',
|
|
183
|
+
'bgFill',
|
|
184
|
+
'underline',
|
|
185
|
+
'underlineStyle',
|
|
186
|
+
'underlineOffset',
|
|
187
|
+
'underlineThickness',
|
|
188
|
+
'strike',
|
|
189
|
+
'href',
|
|
190
|
+
'features',
|
|
191
|
+
'nowrap',
|
|
192
|
+
'shapeApart',
|
|
193
|
+
] as const satisfies readonly (keyof TextRun)[];
|
|
194
|
+
|
|
195
|
+
/** A field of `TextRun` missing from `RUN_FIELDS` names itself here. */
|
|
196
|
+
type Unlisted = Exclude<keyof TextRun, (typeof RUN_FIELDS)[number]>;
|
|
197
|
+
const everyField: [Unlisted] extends [never] ? true : Unlisted = true;
|
|
198
|
+
void everyField;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Whether two runs are the same run: `RUN_FIELDS`, spelled out. A
|
|
202
|
+
* paragraph's runs are compared on every pass over a long document, and
|
|
203
|
+
* walking each run's own fields, or the list's, was most of what finding
|
|
204
|
+
* its layout cost. A field `TextRun` does not name is not the engine's to
|
|
205
|
+
* read, and two runs that differ only there are the same.
|
|
206
|
+
*/
|
|
207
|
+
function sameRun(a: TextRun, b: TextRun): boolean {
|
|
208
|
+
return (
|
|
209
|
+
a.text === b.text &&
|
|
210
|
+
a.family === b.family &&
|
|
211
|
+
a.size === b.size &&
|
|
212
|
+
a.weight === b.weight &&
|
|
213
|
+
a.style === b.style &&
|
|
214
|
+
a.color === b.color &&
|
|
215
|
+
a.letterSpacing === b.letterSpacing &&
|
|
216
|
+
a.bg === b.bg &&
|
|
217
|
+
a.bgFill === b.bgFill &&
|
|
218
|
+
a.underline === b.underline &&
|
|
219
|
+
a.underlineStyle === b.underlineStyle &&
|
|
220
|
+
a.underlineOffset === b.underlineOffset &&
|
|
221
|
+
a.underlineThickness === b.underlineThickness &&
|
|
222
|
+
a.strike === b.strike &&
|
|
223
|
+
a.href === b.href &&
|
|
224
|
+
a.features === b.features &&
|
|
225
|
+
a.nowrap === b.nowrap &&
|
|
226
|
+
a.shapeApart === b.shapeApart
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** Whether two blocks' styles are the same: a block's style is a run's
|
|
231
|
+
* fields, which the engine reads as the paragraph's, without the text. */
|
|
232
|
+
function sameStyle(
|
|
233
|
+
a: Record<string, unknown>,
|
|
234
|
+
b: Record<string, unknown>,
|
|
235
|
+
): boolean {
|
|
236
|
+
return (
|
|
237
|
+
a.family === b.family &&
|
|
238
|
+
a.size === b.size &&
|
|
239
|
+
a.weight === b.weight &&
|
|
240
|
+
a.style === b.style &&
|
|
241
|
+
a.color === b.color &&
|
|
242
|
+
a.letterSpacing === b.letterSpacing &&
|
|
243
|
+
a.bg === b.bg &&
|
|
244
|
+
a.bgFill === b.bgFill &&
|
|
245
|
+
a.underline === b.underline &&
|
|
246
|
+
a.underlineStyle === b.underlineStyle &&
|
|
247
|
+
a.underlineOffset === b.underlineOffset &&
|
|
248
|
+
a.underlineThickness === b.underlineThickness &&
|
|
249
|
+
a.strike === b.strike &&
|
|
250
|
+
a.href === b.href &&
|
|
251
|
+
a.features === b.features &&
|
|
252
|
+
a.nowrap === b.nowrap &&
|
|
253
|
+
a.shapeApart === b.shapeApart
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/** Every option a layout is made with, held to the engine's by the
|
|
258
|
+
* compiler as `RUN_FIELDS` is to `TextRun`. */
|
|
259
|
+
export const OPTION_FIELDS = [
|
|
260
|
+
'maxWidth',
|
|
261
|
+
'lineHeight',
|
|
262
|
+
'align',
|
|
263
|
+
'direction',
|
|
264
|
+
'maxLines',
|
|
265
|
+
'overflow',
|
|
266
|
+
'overflowWrap',
|
|
267
|
+
'wrap',
|
|
268
|
+
] as const satisfies readonly (keyof Options)[];
|
|
269
|
+
|
|
270
|
+
/** An option missing from `OPTION_FIELDS` names itself here. */
|
|
271
|
+
type UnlistedOption = Exclude<keyof Options, (typeof OPTION_FIELDS)[number]>;
|
|
272
|
+
const everyOption: [UnlistedOption] extends [never] ? true : UnlistedOption =
|
|
273
|
+
true;
|
|
274
|
+
void everyOption;
|
|
275
|
+
|
|
276
|
+
/** Whether two layouts' options are the same: `OPTION_FIELDS`, spelled
|
|
277
|
+
* out. */
|
|
278
|
+
function sameOptions(a: Options, b: Options): boolean {
|
|
279
|
+
return (
|
|
280
|
+
a.maxWidth === b.maxWidth &&
|
|
281
|
+
a.lineHeight === b.lineHeight &&
|
|
282
|
+
a.align === b.align &&
|
|
283
|
+
a.direction === b.direction &&
|
|
284
|
+
a.maxLines === b.maxLines &&
|
|
285
|
+
a.overflow === b.overflow &&
|
|
286
|
+
a.overflowWrap === b.overflowWrap &&
|
|
287
|
+
a.wrap === b.wrap
|
|
288
|
+
);
|
|
289
|
+
}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
// The collapsing border model (CSS 2.1 17.6.2).
|
|
2
|
+
//
|
|
3
|
+
// Where borders collapse, a table's cells share the borders between them:
|
|
4
|
+
// every edge of the grid carries one border, chosen from everything that
|
|
5
|
+
// meets there — the cells on either side, their rows and row groups, the
|
|
6
|
+
// columns and column groups, and at the outside the table — and drawn
|
|
7
|
+
// centred on the edge. So the choice is made per segment of the grid, not
|
|
8
|
+
// per box, and it is made here once per box tree: it reads styles and the
|
|
9
|
+
// grid, and neither changes with the width.
|
|
10
|
+
//
|
|
11
|
+
// Layout sees the result as ordinary border widths. A cell's border on a
|
|
12
|
+
// side is half the border drawn along it, and the table's is half of the
|
|
13
|
+
// borders around the outside (17.6.2), so the table algorithm sizes and
|
|
14
|
+
// places cells exactly as before; the table then paints the segments
|
|
15
|
+
// (`paintCollapsedBorders`) and nothing paints the boxes' own.
|
|
16
|
+
import type { BorderStyle, ComputedStyle } from '../css/style.js';
|
|
17
|
+
import { inkColor } from '../css/values.js';
|
|
18
|
+
import type { Box } from './boxes.js';
|
|
19
|
+
import { tableGrid } from './grid.js';
|
|
20
|
+
import type { Cell } from './grid.js';
|
|
21
|
+
|
|
22
|
+
/** The border drawn along one segment of the grid. */
|
|
23
|
+
export interface CollapsedBorder {
|
|
24
|
+
width: number;
|
|
25
|
+
style: BorderStyle;
|
|
26
|
+
color: string;
|
|
27
|
+
/** How it won, for painting the winners last where segments cross. */
|
|
28
|
+
rank: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface Edges {
|
|
32
|
+
top: number;
|
|
33
|
+
right: number;
|
|
34
|
+
bottom: number;
|
|
35
|
+
left: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface CollapsedTable {
|
|
39
|
+
rows: number;
|
|
40
|
+
columns: number;
|
|
41
|
+
/** The border along each row line, per column: `(rows + 1) × columns`,
|
|
42
|
+
* line by line. Null where there is none, or where the line runs
|
|
43
|
+
* through a cell that spans it. */
|
|
44
|
+
horizontal: (CollapsedBorder | null)[];
|
|
45
|
+
/** The border along each column line, per row: `rows × (columns + 1)`,
|
|
46
|
+
* row by row. */
|
|
47
|
+
vertical: (CollapsedBorder | null)[];
|
|
48
|
+
/** What each cell's border widths are, as layout sees them. */
|
|
49
|
+
cells: Map<Box, Edges>;
|
|
50
|
+
/** The table's own border widths. */
|
|
51
|
+
table: Edges;
|
|
52
|
+
/** Where each grid line was laid out, from the table's border-box
|
|
53
|
+
* corner: `columns + 1` and `rows + 1` of them. Set by the table
|
|
54
|
+
* layout, empty until it runs. */
|
|
55
|
+
lineX: number[];
|
|
56
|
+
lineY: number[];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Give a table, or a cell of one, the border widths the collapsing model
|
|
61
|
+
* leaves it, when its table's borders collapse. A table has no padding
|
|
62
|
+
* there (17.6.2).
|
|
63
|
+
*/
|
|
64
|
+
export function collapseEdges(box: Box): void {
|
|
65
|
+
const table = box.kind === 'table' ? box : tableOf(box);
|
|
66
|
+
if (!table || table.style.borderCollapse !== 'collapse') return;
|
|
67
|
+
const grid = (table.collapsed ??= collapseTable(table));
|
|
68
|
+
const edges = box === table ? grid.table : grid.cells.get(box);
|
|
69
|
+
if (!edges) return;
|
|
70
|
+
box.borderTop = edges.top;
|
|
71
|
+
box.borderRight = edges.right;
|
|
72
|
+
box.borderBottom = edges.bottom;
|
|
73
|
+
box.borderLeft = edges.left;
|
|
74
|
+
box.bordersCollapsed = true;
|
|
75
|
+
if (box === table) {
|
|
76
|
+
box.padTop = 0;
|
|
77
|
+
box.padRight = 0;
|
|
78
|
+
box.padBottom = 0;
|
|
79
|
+
box.padLeft = 0;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function tableOf(cell: Box): Box | null {
|
|
84
|
+
const row = cell.parent;
|
|
85
|
+
const up = row?.parent;
|
|
86
|
+
if (up?.kind === 'table') return up;
|
|
87
|
+
const table = up?.parent;
|
|
88
|
+
return table?.kind === 'table' ? table : null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Whose border it is, in the order a tie between two of the same width
|
|
92
|
+
* and style is settled (17.6.2.1). */
|
|
93
|
+
const enum Origin {
|
|
94
|
+
Table = 0,
|
|
95
|
+
ColumnGroup = 1,
|
|
96
|
+
Column = 2,
|
|
97
|
+
RowGroup = 3,
|
|
98
|
+
Row = 4,
|
|
99
|
+
Cell = 5,
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const STYLE_RANK: Record<BorderStyle, number> = {
|
|
103
|
+
none: 0,
|
|
104
|
+
hidden: 0,
|
|
105
|
+
inset: 1,
|
|
106
|
+
groove: 2,
|
|
107
|
+
outset: 3,
|
|
108
|
+
ridge: 4,
|
|
109
|
+
dotted: 5,
|
|
110
|
+
dashed: 6,
|
|
111
|
+
solid: 7,
|
|
112
|
+
double: 8,
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
type Side = 'Top' | 'Right' | 'Bottom' | 'Left';
|
|
116
|
+
|
|
117
|
+
/** Each side's three properties, named once rather than spelled out per
|
|
118
|
+
* segment: a table is resolved on every build, a hundred segments each. */
|
|
119
|
+
const KEYS = {
|
|
120
|
+
Top: ['borderTopStyle', 'borderTopWidth', 'borderTopColor'],
|
|
121
|
+
Right: ['borderRightStyle', 'borderRightWidth', 'borderRightColor'],
|
|
122
|
+
Bottom: ['borderBottomStyle', 'borderBottomWidth', 'borderBottomColor'],
|
|
123
|
+
Left: ['borderLeftStyle', 'borderLeftWidth', 'borderLeftColor'],
|
|
124
|
+
} as const;
|
|
125
|
+
|
|
126
|
+
/** A side of a box's style as a candidate for a segment. */
|
|
127
|
+
interface Candidate {
|
|
128
|
+
style: ComputedStyle;
|
|
129
|
+
side: Side;
|
|
130
|
+
origin: Origin;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The border one segment carries (17.6.2.1): `hidden` anywhere suppresses
|
|
135
|
+
* it; otherwise `none` takes no part, the widest wins, then the style by
|
|
136
|
+
* `double`, `solid`, `dashed`, `dotted`, `ridge`, `outset`, `groove`,
|
|
137
|
+
* `inset`, then the box by cell, row, row group, column, column group,
|
|
138
|
+
* table — and between two of one kind, the one offered first, which the
|
|
139
|
+
* callers make the one to the left or above.
|
|
140
|
+
*/
|
|
141
|
+
function resolve(candidates: Candidate[]): CollapsedBorder | null {
|
|
142
|
+
let best: Candidate | null = null;
|
|
143
|
+
let bestWidth = 0;
|
|
144
|
+
let bestStyle = 0;
|
|
145
|
+
for (const c of candidates) {
|
|
146
|
+
const [styleKey, widthKey] = KEYS[c.side];
|
|
147
|
+
const style = c.style[styleKey];
|
|
148
|
+
if (style === 'hidden') return null;
|
|
149
|
+
if (style === 'none') continue;
|
|
150
|
+
const width = c.style[widthKey];
|
|
151
|
+
const rank = STYLE_RANK[style];
|
|
152
|
+
if (
|
|
153
|
+
best &&
|
|
154
|
+
(width < bestWidth ||
|
|
155
|
+
(width === bestWidth &&
|
|
156
|
+
(rank < bestStyle ||
|
|
157
|
+
(rank === bestStyle && c.origin <= best.origin))))
|
|
158
|
+
) {
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
best = c;
|
|
162
|
+
bestWidth = width;
|
|
163
|
+
bestStyle = rank;
|
|
164
|
+
}
|
|
165
|
+
if (!best || !(bestWidth > 0)) return null;
|
|
166
|
+
const [styleKey, , colorKey] = KEYS[best.side];
|
|
167
|
+
const color = best.style[colorKey];
|
|
168
|
+
return {
|
|
169
|
+
width: bestWidth,
|
|
170
|
+
style: best.style[styleKey],
|
|
171
|
+
color: inkColor(color, best.style.color),
|
|
172
|
+
rank: (bestWidth * 16 + bestStyle) * 8 + best.origin,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** Resolve every segment of a table's grid. */
|
|
177
|
+
export function collapseTable(table: Box): CollapsedTable {
|
|
178
|
+
const {
|
|
179
|
+
rows,
|
|
180
|
+
groups,
|
|
181
|
+
cells,
|
|
182
|
+
columnCount,
|
|
183
|
+
columnBoxes: column,
|
|
184
|
+
columnGroups: group,
|
|
185
|
+
} = tableGrid(table);
|
|
186
|
+
const R = rows.length;
|
|
187
|
+
const C = columnCount;
|
|
188
|
+
const owner: (Cell | null)[] = new Array<Cell | null>(R * C).fill(null);
|
|
189
|
+
for (const cell of cells) {
|
|
190
|
+
const lastRow = Math.min(R, cell.row + cell.rowSpan);
|
|
191
|
+
const lastColumn = Math.min(C, cell.column + cell.colSpan);
|
|
192
|
+
for (let r = cell.row; r < lastRow; r += 1) {
|
|
193
|
+
for (let c = cell.column; c < lastColumn; c += 1) owner[r * C + c] = cell;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
const at = (r: number, c: number): Cell | null =>
|
|
197
|
+
r < 0 || r >= R || c < 0 || c >= C ? null : owner[r * C + c];
|
|
198
|
+
|
|
199
|
+
const candidates: Candidate[] = [];
|
|
200
|
+
const offer = (box: Box | null, side: Side, origin: Origin): void => {
|
|
201
|
+
if (box) candidates.push({ style: box.style, side, origin });
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// along each row line: the cell above and the cell below, their rows and
|
|
205
|
+
// row groups where the line is their edge, and at the top and the bottom
|
|
206
|
+
// of the table the columns, the column groups and the table
|
|
207
|
+
const horizontal: (CollapsedBorder | null)[] =
|
|
208
|
+
new Array<CollapsedBorder | null>((R + 1) * C).fill(null);
|
|
209
|
+
for (let line = 0; line <= R; line += 1) {
|
|
210
|
+
for (let c = 0; c < C; c += 1) {
|
|
211
|
+
const above = at(line - 1, c);
|
|
212
|
+
const below = at(line, c);
|
|
213
|
+
if (above && above === below) continue;
|
|
214
|
+
candidates.length = 0;
|
|
215
|
+
if (above && above.row + above.rowSpan === line) {
|
|
216
|
+
offer(above.box, 'Bottom', Origin.Cell);
|
|
217
|
+
}
|
|
218
|
+
if (below && below.row === line) offer(below.box, 'Top', Origin.Cell);
|
|
219
|
+
if (line > 0) offer(rows[line - 1], 'Bottom', Origin.Row);
|
|
220
|
+
if (line < R) offer(rows[line], 'Top', Origin.Row);
|
|
221
|
+
if (line > 0 && groups[line - 1] !== groups[line]) {
|
|
222
|
+
offer(groups[line - 1], 'Bottom', Origin.RowGroup);
|
|
223
|
+
}
|
|
224
|
+
if (line < R && (line === 0 || groups[line - 1] !== groups[line])) {
|
|
225
|
+
offer(groups[line], 'Top', Origin.RowGroup);
|
|
226
|
+
}
|
|
227
|
+
if (line === 0 || line === R) {
|
|
228
|
+
const side = line === 0 ? 'Top' : 'Bottom';
|
|
229
|
+
offer(column[c], side, Origin.Column);
|
|
230
|
+
offer(group[c], side, Origin.ColumnGroup);
|
|
231
|
+
offer(table, side, Origin.Table);
|
|
232
|
+
}
|
|
233
|
+
horizontal[line * C + c] = resolve(candidates);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// along each column line, the same turned on its side
|
|
238
|
+
const vertical: (CollapsedBorder | null)[] =
|
|
239
|
+
new Array<CollapsedBorder | null>(R * (C + 1)).fill(null);
|
|
240
|
+
for (let r = 0; r < R; r += 1) {
|
|
241
|
+
for (let line = 0; line <= C; line += 1) {
|
|
242
|
+
const left = at(r, line - 1);
|
|
243
|
+
const right = at(r, line);
|
|
244
|
+
if (left && left === right) continue;
|
|
245
|
+
candidates.length = 0;
|
|
246
|
+
if (left && left.column + left.colSpan === line) {
|
|
247
|
+
offer(left.box, 'Right', Origin.Cell);
|
|
248
|
+
}
|
|
249
|
+
if (right && right.column === line) {
|
|
250
|
+
offer(right.box, 'Left', Origin.Cell);
|
|
251
|
+
}
|
|
252
|
+
if (line > 0) offer(column[line - 1], 'Right', Origin.Column);
|
|
253
|
+
if (line < C) offer(column[line], 'Left', Origin.Column);
|
|
254
|
+
if (line > 0 && (line === C || group[line - 1] !== group[line])) {
|
|
255
|
+
offer(group[line - 1], 'Right', Origin.ColumnGroup);
|
|
256
|
+
}
|
|
257
|
+
if (line < C && (line === 0 || group[line - 1] !== group[line])) {
|
|
258
|
+
offer(group[line], 'Left', Origin.ColumnGroup);
|
|
259
|
+
}
|
|
260
|
+
if (line === 0 || line === C) {
|
|
261
|
+
const side = line === 0 ? 'Left' : 'Right';
|
|
262
|
+
offer(rows[r], side, Origin.Row);
|
|
263
|
+
offer(groups[r], side, Origin.RowGroup);
|
|
264
|
+
offer(table, side, Origin.Table);
|
|
265
|
+
}
|
|
266
|
+
vertical[r * (C + 1) + line] = resolve(candidates);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const widthOf = (b: CollapsedBorder | null): number => (b ? b.width : 0);
|
|
271
|
+
const cellEdges = new Map<Box, Edges>();
|
|
272
|
+
for (const cell of cells) {
|
|
273
|
+
const lastRow = Math.min(R, cell.row + cell.rowSpan);
|
|
274
|
+
const lastColumn = Math.min(C, cell.column + cell.colSpan);
|
|
275
|
+
const edges: Edges = { top: 0, right: 0, bottom: 0, left: 0 };
|
|
276
|
+
for (let c = cell.column; c < lastColumn; c += 1) {
|
|
277
|
+
const top = widthOf(horizontal[cell.row * C + c]);
|
|
278
|
+
const bottom = widthOf(horizontal[lastRow * C + c]);
|
|
279
|
+
edges.top = Math.max(edges.top, top / 2);
|
|
280
|
+
edges.bottom = Math.max(edges.bottom, bottom / 2);
|
|
281
|
+
}
|
|
282
|
+
for (let r = cell.row; r < lastRow; r += 1) {
|
|
283
|
+
const left = widthOf(vertical[r * (C + 1) + cell.column]);
|
|
284
|
+
const right = widthOf(vertical[r * (C + 1) + lastColumn]);
|
|
285
|
+
edges.left = Math.max(edges.left, left / 2);
|
|
286
|
+
edges.right = Math.max(edges.right, right / 2);
|
|
287
|
+
}
|
|
288
|
+
cellEdges.set(cell.box, edges);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// The table's own: half the widest of its outer borders along each side
|
|
292
|
+
// (CSS Tables 3, 3.9.1), as browsers have it. CSS 2.1 (17.6.2) took the
|
|
293
|
+
// first row's at the sides and let a later row's wider one spill into
|
|
294
|
+
// the margin, where the table's background did not reach under it.
|
|
295
|
+
const edges: Edges = { top: 0, right: 0, bottom: 0, left: 0 };
|
|
296
|
+
if (R && C) {
|
|
297
|
+
for (let r = 0; r < R; r += 1) {
|
|
298
|
+
const row = r * (C + 1);
|
|
299
|
+
edges.left = Math.max(edges.left, widthOf(vertical[row]) / 2);
|
|
300
|
+
edges.right = Math.max(edges.right, widthOf(vertical[row + C]) / 2);
|
|
301
|
+
}
|
|
302
|
+
for (let c = 0; c < C; c += 1) {
|
|
303
|
+
edges.top = Math.max(edges.top, widthOf(horizontal[c]) / 2);
|
|
304
|
+
edges.bottom = Math.max(edges.bottom, widthOf(horizontal[R * C + c]) / 2);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
rows: R,
|
|
309
|
+
columns: C,
|
|
310
|
+
horizontal,
|
|
311
|
+
vertical,
|
|
312
|
+
cells: cellEdges,
|
|
313
|
+
table: edges,
|
|
314
|
+
lineX: [],
|
|
315
|
+
lineY: [],
|
|
316
|
+
};
|
|
317
|
+
}
|