@oh-just-another/react-ui 0.61.0 → 0.62.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/CHANGELOG.md +121 -0
- package/README.md +3 -3
- package/dist/.tsbuildinfo +1 -1
- package/dist/color/color-palette.d.ts.map +1 -0
- package/dist/color/color-palette.js.map +1 -0
- package/dist/color/color-swatch-picker.d.ts.map +1 -0
- package/dist/{color-swatch-picker.js → color/color-swatch-picker.js} +4 -3
- package/dist/color/color-swatch-picker.js.map +1 -0
- package/dist/{constants.d.ts → core/constants.d.ts} +66 -14
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/{constants.js → core/constants.js} +99 -14
- package/dist/core/constants.js.map +1 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/context.js.map +1 -0
- package/dist/core/hooks.d.ts.map +1 -0
- package/dist/core/hooks.js.map +1 -0
- package/dist/core/portal-container.d.ts.map +1 -0
- package/dist/core/portal-container.js.map +1 -0
- package/dist/core/use-fullscreen.d.ts +14 -0
- package/dist/core/use-fullscreen.d.ts.map +1 -0
- package/dist/core/use-fullscreen.js +38 -0
- package/dist/core/use-fullscreen.js.map +1 -0
- package/dist/core/use-quiet-gesture.d.ts +11 -0
- package/dist/core/use-quiet-gesture.d.ts.map +1 -0
- package/dist/core/use-quiet-gesture.js +61 -0
- package/dist/core/use-quiet-gesture.js.map +1 -0
- package/dist/core/use-quiet-viewport.d.ts +10 -0
- package/dist/core/use-quiet-viewport.d.ts.map +1 -0
- package/dist/core/use-quiet-viewport.js +40 -0
- package/dist/core/use-quiet-viewport.js.map +1 -0
- package/dist/index.d.ts +55 -50
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +55 -50
- package/dist/index.js.map +1 -1
- package/dist/layout/diagram-bars.d.ts.map +1 -0
- package/dist/layout/diagram-bars.js.map +1 -0
- package/dist/layout/diagram-canvas.d.ts.map +1 -0
- package/dist/layout/diagram-canvas.js.map +1 -0
- package/dist/layout/diagram-root.d.ts.map +1 -0
- package/dist/{diagram-root.js → layout/diagram-root.js} +2 -2
- package/dist/layout/diagram-root.js.map +1 -0
- package/dist/{sidebar.d.ts → layout/sidebar.d.ts} +1 -0
- package/dist/layout/sidebar.d.ts.map +1 -0
- package/dist/layout/sidebar.js +38 -0
- package/dist/layout/sidebar.js.map +1 -0
- package/dist/layout/ui-layer.d.ts.map +1 -0
- package/dist/layout/ui-layer.js.map +1 -0
- package/dist/menus/command-palette.d.ts.map +1 -0
- package/dist/{command-palette.js → menus/command-palette.js} +2 -2
- package/dist/menus/command-palette.js.map +1 -0
- package/dist/menus/context-menu-controller.d.ts.map +1 -0
- package/dist/menus/context-menu-controller.js.map +1 -0
- package/dist/{context-menu.d.ts → menus/context-menu.d.ts} +12 -0
- package/dist/menus/context-menu.d.ts.map +1 -0
- package/dist/menus/context-menu.js +617 -0
- package/dist/menus/context-menu.js.map +1 -0
- package/dist/menus/link-drop-shape-menu.d.ts.map +1 -0
- package/dist/{link-drop-shape-menu.js → menus/link-drop-shape-menu.js} +4 -4
- package/dist/menus/link-drop-shape-menu.js.map +1 -0
- package/dist/{main-menu.d.ts → menus/main-menu.d.ts} +45 -2
- package/dist/menus/main-menu.d.ts.map +1 -0
- package/dist/menus/main-menu.js +260 -0
- package/dist/menus/main-menu.js.map +1 -0
- package/dist/overlays/file-drop-overlay.d.ts +15 -0
- package/dist/overlays/file-drop-overlay.d.ts.map +1 -0
- package/dist/overlays/file-drop-overlay.js +27 -0
- package/dist/overlays/file-drop-overlay.js.map +1 -0
- package/dist/overlays/frame-name-editor-overlay.d.ts.map +1 -0
- package/dist/{frame-name-editor-overlay.js → overlays/frame-name-editor-overlay.js} +1 -1
- package/dist/overlays/frame-name-editor-overlay.js.map +1 -0
- package/dist/overlays/help-button.d.ts.map +1 -0
- package/dist/{help-button.js → overlays/help-button.js} +3 -4
- package/dist/overlays/help-button.js.map +1 -0
- package/dist/overlays/help-dialog.d.ts.map +1 -0
- package/dist/{help-dialog.js → overlays/help-dialog.js} +4 -24
- package/dist/overlays/help-dialog.js.map +1 -0
- package/dist/overlays/link-badges.d.ts +14 -0
- package/dist/overlays/link-badges.d.ts.map +1 -0
- package/dist/overlays/link-badges.js +60 -0
- package/dist/overlays/link-badges.js.map +1 -0
- package/dist/overlays/link-caption-editor.d.ts.map +1 -0
- package/dist/{link-caption-editor.js → overlays/link-caption-editor.js} +3 -3
- package/dist/overlays/link-caption-editor.js.map +1 -0
- package/dist/overlays/link-hover-popup.d.ts.map +1 -0
- package/dist/{link-hover-popup.js → overlays/link-hover-popup.js} +5 -4
- package/dist/overlays/link-hover-popup.js.map +1 -0
- package/dist/overlays/merge-dialog.d.ts.map +1 -0
- package/dist/overlays/merge-dialog.js +39 -0
- package/dist/overlays/merge-dialog.js.map +1 -0
- package/dist/overlays/search-overlay.d.ts.map +1 -0
- package/dist/{search-overlay.js → overlays/search-overlay.js} +2 -2
- package/dist/overlays/search-overlay.js.map +1 -0
- package/dist/overlays/sticky-reactions.d.ts +2 -0
- package/dist/overlays/sticky-reactions.d.ts.map +1 -0
- package/dist/overlays/sticky-reactions.js +94 -0
- package/dist/overlays/sticky-reactions.js.map +1 -0
- package/dist/overlays/text-editor-overlay.d.ts.map +1 -0
- package/dist/{text-editor-overlay.js → overlays/text-editor-overlay.js} +37 -5
- package/dist/overlays/text-editor-overlay.js.map +1 -0
- package/dist/{comments-panel.d.ts → panels/comments-panel.d.ts} +4 -1
- package/dist/panels/comments-panel.d.ts.map +1 -0
- package/dist/panels/comments-panel.js +51 -0
- package/dist/panels/comments-panel.js.map +1 -0
- package/dist/panels/diff-panel.d.ts.map +1 -0
- package/dist/panels/diff-panel.js.map +1 -0
- package/dist/panels/drawing-panel.d.ts.map +1 -0
- package/dist/{drawing-panel.js → panels/drawing-panel.js} +3 -3
- package/dist/panels/drawing-panel.js.map +1 -0
- package/dist/panels/edge-style-panel.d.ts.map +1 -0
- package/dist/{edge-style-panel.js → panels/edge-style-panel.js} +1 -1
- package/dist/panels/edge-style-panel.js.map +1 -0
- package/dist/panels/frame-panel.d.ts.map +1 -0
- package/dist/{frame-panel.js → panels/frame-panel.js} +1 -1
- package/dist/panels/frame-panel.js.map +1 -0
- package/dist/{layer-panel.d.ts → panels/layer-panel.d.ts} +5 -1
- package/dist/panels/layer-panel.d.ts.map +1 -0
- package/dist/panels/layer-panel.js +52 -0
- package/dist/panels/layer-panel.js.map +1 -0
- package/dist/panels/library-panel.d.ts.map +1 -0
- package/dist/{library-panel.js → panels/library-panel.js} +4 -5
- package/dist/panels/library-panel.js.map +1 -0
- package/dist/panels/property-panel.d.ts.map +1 -0
- package/dist/panels/property-panel.js +1397 -0
- package/dist/panels/property-panel.js.map +1 -0
- package/dist/panels/selection-floating-panel.d.ts.map +1 -0
- package/dist/{selection-floating-panel.js → panels/selection-floating-panel.js} +24 -13
- package/dist/panels/selection-floating-panel.js.map +1 -0
- package/dist/panels/stats-panel.d.ts.map +1 -0
- package/dist/{stats-panel.js → panels/stats-panel.js} +1 -1
- package/dist/panels/stats-panel.js.map +1 -0
- package/dist/primitives/bottom-sheet.d.ts.map +1 -0
- package/dist/{bottom-sheet.js → primitives/bottom-sheet.js} +9 -22
- package/dist/primitives/bottom-sheet.js.map +1 -0
- package/dist/primitives/button-group.d.ts.map +1 -0
- package/dist/primitives/button-group.js.map +1 -0
- package/dist/primitives/css-var.d.ts +8 -0
- package/dist/primitives/css-var.d.ts.map +1 -0
- package/dist/primitives/css-var.js +11 -0
- package/dist/primitives/css-var.js.map +1 -0
- package/dist/primitives/float-panel.d.ts +35 -0
- package/dist/primitives/float-panel.d.ts.map +1 -0
- package/dist/primitives/float-panel.js +42 -0
- package/dist/primitives/float-panel.js.map +1 -0
- package/dist/primitives/icon-button.d.ts.map +1 -0
- package/dist/primitives/icon-button.js.map +1 -0
- package/dist/primitives/markdown.d.ts.map +1 -0
- package/dist/primitives/markdown.js.map +1 -0
- package/dist/primitives/modal.d.ts.map +1 -0
- package/dist/{modal.js → primitives/modal.js} +11 -9
- package/dist/primitives/modal.js.map +1 -0
- package/dist/{popover.d.ts → primitives/popover.d.ts} +1 -1
- package/dist/primitives/popover.d.ts.map +1 -0
- package/dist/{popover.js → primitives/popover.js} +7 -18
- package/dist/primitives/popover.js.map +1 -0
- package/dist/primitives/segmented-control.d.ts.map +1 -0
- package/dist/primitives/segmented-control.js.map +1 -0
- package/dist/primitives/slider.d.ts.map +1 -0
- package/dist/primitives/slider.js.map +1 -0
- package/dist/primitives/switch.d.ts +24 -0
- package/dist/primitives/switch.d.ts.map +1 -0
- package/dist/primitives/switch.js +17 -0
- package/dist/primitives/switch.js.map +1 -0
- package/dist/primitives/toast.d.ts.map +1 -0
- package/dist/{toast.js → primitives/toast.js} +12 -33
- package/dist/primitives/toast.js.map +1 -0
- package/dist/primitives/tooltip.d.ts.map +1 -0
- package/dist/{tooltip.js → primitives/tooltip.js} +3 -3
- package/dist/primitives/tooltip.js.map +1 -0
- package/dist/{palette.d.ts → toolbar/palette.d.ts} +6 -1
- package/dist/toolbar/palette.d.ts.map +1 -0
- package/dist/{palette.js → toolbar/palette.js} +39 -5
- package/dist/toolbar/palette.js.map +1 -0
- package/dist/{toolbar.d.ts → toolbar/toolbar.d.ts} +9 -0
- package/dist/toolbar/toolbar.d.ts.map +1 -0
- package/dist/{toolbar.js → toolbar/toolbar.js} +132 -62
- package/dist/toolbar/toolbar.js.map +1 -0
- package/dist/utils/format-time.d.ts.map +1 -0
- package/dist/utils/format-time.js.map +1 -0
- package/dist/utils/use-dismiss-timer.d.ts.map +1 -0
- package/dist/utils/use-dismiss-timer.js.map +1 -0
- package/dist/widgets/minimap.d.ts.map +1 -0
- package/dist/{minimap.js → widgets/minimap.js} +50 -36
- package/dist/widgets/minimap.js.map +1 -0
- package/dist/widgets/reset-to-content-button.d.ts +11 -0
- package/dist/widgets/reset-to-content-button.d.ts.map +1 -0
- package/dist/{reset-to-content-button.js → widgets/reset-to-content-button.js} +8 -9
- package/dist/widgets/reset-to-content-button.js.map +1 -0
- package/dist/widgets/versioning.d.ts.map +1 -0
- package/dist/{versioning.js → widgets/versioning.js} +3 -3
- package/dist/widgets/versioning.js.map +1 -0
- package/dist/widgets/zen-mode.d.ts.map +1 -0
- package/dist/widgets/zen-mode.js.map +1 -0
- package/package.json +9 -9
- package/src/styles.css +1590 -258
- package/dist/bottom-sheet.d.ts.map +0 -1
- package/dist/bottom-sheet.js.map +0 -1
- package/dist/button-group.d.ts.map +0 -1
- package/dist/button-group.js.map +0 -1
- package/dist/color-palette.d.ts.map +0 -1
- package/dist/color-palette.js.map +0 -1
- package/dist/color-swatch-picker.d.ts.map +0 -1
- package/dist/color-swatch-picker.js.map +0 -1
- package/dist/command-palette.d.ts.map +0 -1
- package/dist/command-palette.js.map +0 -1
- package/dist/comments-panel.d.ts.map +0 -1
- package/dist/comments-panel.js +0 -142
- package/dist/comments-panel.js.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/context-menu-controller.d.ts.map +0 -1
- package/dist/context-menu-controller.js.map +0 -1
- package/dist/context-menu.d.ts.map +0 -1
- package/dist/context-menu.js +0 -368
- package/dist/context-menu.js.map +0 -1
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js.map +0 -1
- package/dist/diagram-bars.d.ts.map +0 -1
- package/dist/diagram-bars.js.map +0 -1
- package/dist/diagram-canvas.d.ts.map +0 -1
- package/dist/diagram-canvas.js.map +0 -1
- package/dist/diagram-root.d.ts.map +0 -1
- package/dist/diagram-root.js.map +0 -1
- package/dist/diff-panel.d.ts.map +0 -1
- package/dist/diff-panel.js.map +0 -1
- package/dist/drawing-panel.d.ts.map +0 -1
- package/dist/drawing-panel.js.map +0 -1
- package/dist/edge-style-panel.d.ts.map +0 -1
- package/dist/edge-style-panel.js.map +0 -1
- package/dist/format-time.d.ts.map +0 -1
- package/dist/format-time.js.map +0 -1
- package/dist/frame-name-editor-overlay.d.ts.map +0 -1
- package/dist/frame-name-editor-overlay.js.map +0 -1
- package/dist/frame-panel.d.ts.map +0 -1
- package/dist/frame-panel.js.map +0 -1
- package/dist/help-button.d.ts.map +0 -1
- package/dist/help-button.js.map +0 -1
- package/dist/help-dialog.d.ts.map +0 -1
- package/dist/help-dialog.js.map +0 -1
- package/dist/hooks.d.ts.map +0 -1
- package/dist/hooks.js.map +0 -1
- package/dist/icon-button.d.ts.map +0 -1
- package/dist/icon-button.js.map +0 -1
- package/dist/layer-panel.d.ts.map +0 -1
- package/dist/layer-panel.js +0 -117
- package/dist/layer-panel.js.map +0 -1
- package/dist/library-panel.d.ts.map +0 -1
- package/dist/library-panel.js.map +0 -1
- package/dist/link-caption-editor.d.ts.map +0 -1
- package/dist/link-caption-editor.js.map +0 -1
- package/dist/link-drop-shape-menu.d.ts.map +0 -1
- package/dist/link-drop-shape-menu.js.map +0 -1
- package/dist/link-hover-popup.d.ts.map +0 -1
- package/dist/link-hover-popup.js.map +0 -1
- package/dist/main-menu.d.ts.map +0 -1
- package/dist/main-menu.js +0 -249
- package/dist/main-menu.js.map +0 -1
- package/dist/markdown.d.ts.map +0 -1
- package/dist/markdown.js.map +0 -1
- package/dist/merge-dialog.d.ts.map +0 -1
- package/dist/merge-dialog.js +0 -50
- package/dist/merge-dialog.js.map +0 -1
- package/dist/minimap.d.ts.map +0 -1
- package/dist/minimap.js.map +0 -1
- package/dist/modal.d.ts.map +0 -1
- package/dist/modal.js.map +0 -1
- package/dist/palette.d.ts.map +0 -1
- package/dist/palette.js.map +0 -1
- package/dist/popover.d.ts.map +0 -1
- package/dist/popover.js.map +0 -1
- package/dist/portal-container.d.ts.map +0 -1
- package/dist/portal-container.js.map +0 -1
- package/dist/property-panel.d.ts.map +0 -1
- package/dist/property-panel.js +0 -917
- package/dist/property-panel.js.map +0 -1
- package/dist/reset-to-content-button.d.ts +0 -10
- package/dist/reset-to-content-button.d.ts.map +0 -1
- package/dist/reset-to-content-button.js.map +0 -1
- package/dist/search-overlay.d.ts.map +0 -1
- package/dist/search-overlay.js.map +0 -1
- package/dist/segmented-control.d.ts.map +0 -1
- package/dist/segmented-control.js.map +0 -1
- package/dist/selection-floating-panel.d.ts.map +0 -1
- package/dist/selection-floating-panel.js.map +0 -1
- package/dist/sidebar.d.ts.map +0 -1
- package/dist/sidebar.js +0 -68
- package/dist/sidebar.js.map +0 -1
- package/dist/slider.d.ts.map +0 -1
- package/dist/slider.js.map +0 -1
- package/dist/stats-panel.d.ts.map +0 -1
- package/dist/stats-panel.js.map +0 -1
- package/dist/text-editor-overlay.d.ts.map +0 -1
- package/dist/text-editor-overlay.js.map +0 -1
- package/dist/toast.d.ts.map +0 -1
- package/dist/toast.js.map +0 -1
- package/dist/toolbar.d.ts.map +0 -1
- package/dist/toolbar.js.map +0 -1
- package/dist/tooltip.d.ts.map +0 -1
- package/dist/tooltip.js.map +0 -1
- package/dist/ui-layer.d.ts.map +0 -1
- package/dist/ui-layer.js.map +0 -1
- package/dist/use-dismiss-timer.d.ts.map +0 -1
- package/dist/use-dismiss-timer.js.map +0 -1
- package/dist/versioning.d.ts.map +0 -1
- package/dist/versioning.js.map +0 -1
- package/dist/zen-mode.d.ts.map +0 -1
- package/dist/zen-mode.js.map +0 -1
- /package/dist/{color-palette.d.ts → color/color-palette.d.ts} +0 -0
- /package/dist/{color-palette.js → color/color-palette.js} +0 -0
- /package/dist/{color-swatch-picker.d.ts → color/color-swatch-picker.d.ts} +0 -0
- /package/dist/{context.d.ts → core/context.d.ts} +0 -0
- /package/dist/{context.js → core/context.js} +0 -0
- /package/dist/{hooks.d.ts → core/hooks.d.ts} +0 -0
- /package/dist/{hooks.js → core/hooks.js} +0 -0
- /package/dist/{portal-container.d.ts → core/portal-container.d.ts} +0 -0
- /package/dist/{portal-container.js → core/portal-container.js} +0 -0
- /package/dist/{diagram-bars.d.ts → layout/diagram-bars.d.ts} +0 -0
- /package/dist/{diagram-bars.js → layout/diagram-bars.js} +0 -0
- /package/dist/{diagram-canvas.d.ts → layout/diagram-canvas.d.ts} +0 -0
- /package/dist/{diagram-canvas.js → layout/diagram-canvas.js} +0 -0
- /package/dist/{diagram-root.d.ts → layout/diagram-root.d.ts} +0 -0
- /package/dist/{ui-layer.d.ts → layout/ui-layer.d.ts} +0 -0
- /package/dist/{ui-layer.js → layout/ui-layer.js} +0 -0
- /package/dist/{command-palette.d.ts → menus/command-palette.d.ts} +0 -0
- /package/dist/{context-menu-controller.d.ts → menus/context-menu-controller.d.ts} +0 -0
- /package/dist/{context-menu-controller.js → menus/context-menu-controller.js} +0 -0
- /package/dist/{link-drop-shape-menu.d.ts → menus/link-drop-shape-menu.d.ts} +0 -0
- /package/dist/{frame-name-editor-overlay.d.ts → overlays/frame-name-editor-overlay.d.ts} +0 -0
- /package/dist/{help-button.d.ts → overlays/help-button.d.ts} +0 -0
- /package/dist/{help-dialog.d.ts → overlays/help-dialog.d.ts} +0 -0
- /package/dist/{link-caption-editor.d.ts → overlays/link-caption-editor.d.ts} +0 -0
- /package/dist/{link-hover-popup.d.ts → overlays/link-hover-popup.d.ts} +0 -0
- /package/dist/{merge-dialog.d.ts → overlays/merge-dialog.d.ts} +0 -0
- /package/dist/{search-overlay.d.ts → overlays/search-overlay.d.ts} +0 -0
- /package/dist/{text-editor-overlay.d.ts → overlays/text-editor-overlay.d.ts} +0 -0
- /package/dist/{diff-panel.d.ts → panels/diff-panel.d.ts} +0 -0
- /package/dist/{diff-panel.js → panels/diff-panel.js} +0 -0
- /package/dist/{drawing-panel.d.ts → panels/drawing-panel.d.ts} +0 -0
- /package/dist/{edge-style-panel.d.ts → panels/edge-style-panel.d.ts} +0 -0
- /package/dist/{frame-panel.d.ts → panels/frame-panel.d.ts} +0 -0
- /package/dist/{library-panel.d.ts → panels/library-panel.d.ts} +0 -0
- /package/dist/{property-panel.d.ts → panels/property-panel.d.ts} +0 -0
- /package/dist/{selection-floating-panel.d.ts → panels/selection-floating-panel.d.ts} +0 -0
- /package/dist/{stats-panel.d.ts → panels/stats-panel.d.ts} +0 -0
- /package/dist/{bottom-sheet.d.ts → primitives/bottom-sheet.d.ts} +0 -0
- /package/dist/{button-group.d.ts → primitives/button-group.d.ts} +0 -0
- /package/dist/{button-group.js → primitives/button-group.js} +0 -0
- /package/dist/{icon-button.d.ts → primitives/icon-button.d.ts} +0 -0
- /package/dist/{icon-button.js → primitives/icon-button.js} +0 -0
- /package/dist/{markdown.d.ts → primitives/markdown.d.ts} +0 -0
- /package/dist/{markdown.js → primitives/markdown.js} +0 -0
- /package/dist/{modal.d.ts → primitives/modal.d.ts} +0 -0
- /package/dist/{segmented-control.d.ts → primitives/segmented-control.d.ts} +0 -0
- /package/dist/{segmented-control.js → primitives/segmented-control.js} +0 -0
- /package/dist/{slider.d.ts → primitives/slider.d.ts} +0 -0
- /package/dist/{slider.js → primitives/slider.js} +0 -0
- /package/dist/{toast.d.ts → primitives/toast.d.ts} +0 -0
- /package/dist/{tooltip.d.ts → primitives/tooltip.d.ts} +0 -0
- /package/dist/{format-time.d.ts → utils/format-time.d.ts} +0 -0
- /package/dist/{format-time.js → utils/format-time.js} +0 -0
- /package/dist/{use-dismiss-timer.d.ts → utils/use-dismiss-timer.d.ts} +0 -0
- /package/dist/{use-dismiss-timer.js → utils/use-dismiss-timer.js} +0 -0
- /package/dist/{minimap.d.ts → widgets/minimap.d.ts} +0 -0
- /package/dist/{versioning.d.ts → widgets/versioning.d.ts} +0 -0
- /package/dist/{zen-mode.d.ts → widgets/zen-mode.d.ts} +0 -0
- /package/dist/{zen-mode.js → widgets/zen-mode.js} +0 -0
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { Pipette, Plus, X } from "lucide-react";
|
|
4
4
|
import { ELEMENT_PALETTE_LIGHT } from "./color-palette.js";
|
|
5
|
+
import { BADGE_ICON } from "../core/constants.js";
|
|
5
6
|
export const ColorSwatchPicker = ({ value, onChange, palette, allowCustom = true, allowClear = true, onEyedrop, }) => {
|
|
6
7
|
// The canvas is not themed (always light paper), so element colors are
|
|
7
8
|
// picked from the light palette regardless of the chrome theme.
|
|
@@ -13,9 +14,9 @@ export const ColorSwatchPicker = ({ value, onChange, palette, allowCustom = true
|
|
|
13
14
|
onEyedrop((c) => {
|
|
14
15
|
onChange(c);
|
|
15
16
|
});
|
|
16
|
-
}, className: "du-swatch du-swatch-eyedrop", children: _jsx("span", { className: "du-swatch-fill du-swatch-fill-blank", children: _jsx(Pipette, {
|
|
17
|
+
}, className: "du-swatch du-swatch-eyedrop", children: _jsx("span", { className: "du-swatch-fill du-swatch-fill-blank", children: _jsx(Pipette, { ...BADGE_ICON }) }) })) : null, allowClear ? (_jsx("button", { type: "button", "aria-label": "Clear colour", title: "Clear colour", onClick: () => {
|
|
17
18
|
onChange(null);
|
|
18
|
-
}, className: "du-swatch du-swatch-clear", children: _jsx("span", { className: "du-swatch-fill du-swatch-fill-blank", children: _jsx(X, {
|
|
19
|
+
}, className: "du-swatch du-swatch-clear", children: _jsx("span", { className: "du-swatch-fill du-swatch-fill-blank", children: _jsx(X, { ...BADGE_ICON }) }) })) : null] }));
|
|
19
20
|
};
|
|
20
21
|
const Swatch = ({ color, selected, onClick, }) => {
|
|
21
22
|
const isTransparent = color === "transparent";
|
|
@@ -32,7 +33,7 @@ const Swatch = ({ color, selected, onClick, }) => {
|
|
|
32
33
|
*/
|
|
33
34
|
const CustomSwatch = ({ value, onChange, open, onOpenChange, }) => {
|
|
34
35
|
const hasColour = !!value && value !== "transparent";
|
|
35
|
-
return (_jsxs("label", { className: "du-swatch du-swatch-custom", title: "Pick custom colour", children: [_jsx("span", { className: "du-swatch-fill", style: hasColour ? { background: value } : undefined, children: hasColour ? null : _jsx(Plus, {
|
|
36
|
+
return (_jsxs("label", { className: "du-swatch du-swatch-custom", title: "Pick custom colour", children: [_jsx("span", { className: "du-swatch-fill", style: hasColour ? { background: value } : undefined, children: hasColour ? null : _jsx(Plus, { ...BADGE_ICON }) }), _jsx("input", { type: "color", "aria-label": "Custom colour", value: normaliseHex(value), onChange: (ev) => {
|
|
36
37
|
onChange(ev.target.value);
|
|
37
38
|
onOpenChange(false);
|
|
38
39
|
}, onClick: () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-swatch-picker.js","sourceRoot":"","sources":["../../src/color/color-swatch-picker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAqClD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAW,GAAG,IAAI,EAClB,UAAU,GAAG,IAAI,EACjB,SAAS,GACc,EAAE,EAAE;IAC3B,uEAAuE;IACvE,gEAAgE;IAChE,MAAM,QAAQ,GAAG,OAAO,IAAI,qBAAqB,CAAC;IAClD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,OAAO,CACL,eAAK,SAAS,EAAC,gBAAgB,EAAC,IAAI,EAAC,YAAY,gBAAY,QAAQ,aAClE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACnB,KAAC,MAAM,IAEL,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,KAAK,CAAC,EAC3C,OAAO,EAAE,GAAG,EAAE;oBACZ,QAAQ,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC3C,CAAC,IALI,CAAC,CAMN,CACH,CAAC,EACD,WAAW,CAAC,CAAC,CAAC,CACb,KAAC,YAAY,IACX,KAA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AiB,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;IAC9D,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAClC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC;IACrE,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -11,18 +11,27 @@ export declare const PALETTE_WIDTH = 200;
|
|
|
11
11
|
export declare const PALETTE_ITEM_SIZE = 28;
|
|
12
12
|
/** Width of the right property panel, in CSS pixels. */
|
|
13
13
|
export declare const PROPERTY_PANEL_WIDTH = 240;
|
|
14
|
+
/** Drop glyph in the centre of the file-drop overlay. */
|
|
15
|
+
export declare const DROP_OVERLAY_ICON_SIZE = 48;
|
|
16
|
+
export declare const ICON_STROKE = 2;
|
|
17
|
+
export declare const CONTROL_ICON: {
|
|
18
|
+
readonly size: 24;
|
|
19
|
+
readonly strokeWidth: 2;
|
|
20
|
+
};
|
|
21
|
+
export declare const ROW_ICON: {
|
|
22
|
+
readonly size: 20;
|
|
23
|
+
readonly strokeWidth: 2;
|
|
24
|
+
};
|
|
25
|
+
export declare const MARK_ICON: {
|
|
26
|
+
readonly size: 12;
|
|
27
|
+
readonly strokeWidth: 2;
|
|
28
|
+
};
|
|
29
|
+
export declare const BADGE_ICON: {
|
|
30
|
+
readonly size: 12;
|
|
31
|
+
readonly strokeWidth: 2;
|
|
32
|
+
};
|
|
14
33
|
/** Pixel side of the colour swatches inside the property panel. */
|
|
15
34
|
export declare const PROPERTY_SWATCH_SIZE = 12;
|
|
16
|
-
/** Width of the layer panel, in CSS pixels. */
|
|
17
|
-
export declare const LAYER_PANEL_WIDTH = 220;
|
|
18
|
-
/** Pixel side of the toggle icon (visibility / lock) buttons. */
|
|
19
|
-
export declare const LAYER_TOGGLE_ICON_SIZE = 20;
|
|
20
|
-
/** Pixel side of the per-row colour swatch in the layer panel. */
|
|
21
|
-
export declare const LAYER_SWATCH_SIZE = 22;
|
|
22
|
-
/** Width of the comments popover, in CSS pixels. */
|
|
23
|
-
export declare const COMMENTS_PANEL_WIDTH = 280;
|
|
24
|
-
/** Pixel height of the toolbar vertical separator. */
|
|
25
|
-
export declare const TOOLBAR_SEPARATOR_HEIGHT = 20;
|
|
26
35
|
/**
|
|
27
36
|
* Default auto-dismiss time for a toast (ms). 0 / Infinity keep it
|
|
28
37
|
* open until the user clicks the × — useful for sticky errors.
|
|
@@ -83,6 +92,17 @@ export declare const SELECTION_PANEL_EDGE_INSET_BOTTOM_PX = 66;
|
|
|
83
92
|
/** Inset from the LEFT edge — small margin (no left-docked chrome by default). */
|
|
84
93
|
export declare const SELECTION_PANEL_EDGE_INSET_LEFT_PX = 16;
|
|
85
94
|
export declare const POPOVER_OFFSET_PX = 6;
|
|
95
|
+
/** Minimum distance a popover keeps from the viewport edges (px). Range: 4–16. */
|
|
96
|
+
export declare const POPOVER_VIEWPORT_PADDING_PX = 6;
|
|
97
|
+
/**
|
|
98
|
+
* Minimum distance the context menu (and its submenus) keeps from the
|
|
99
|
+
* viewport edges — matches the side inset of the static toolbars, so a menu
|
|
100
|
+
* pushed against an edge lines up with the docked chrome. The menu is
|
|
101
|
+
* clamped to the WINDOW, not the canvas: it may overhang an embedded
|
|
102
|
+
* canvas, and when the window is shorter than the menu it scrolls.
|
|
103
|
+
* Range: 8–24.
|
|
104
|
+
*/
|
|
105
|
+
export declare const MENU_VIEWPORT_PADDING_PX = 16;
|
|
86
106
|
/**
|
|
87
107
|
* Text contextual-panel controls.
|
|
88
108
|
*
|
|
@@ -114,9 +134,13 @@ export declare const SEARCH_ZOOM_PADDING_PX = 160;
|
|
|
114
134
|
* - `MINIMAP_WIDTH_PX` / `MINIMAP_HEIGHT_PX` — default canvas size in CSS px.
|
|
115
135
|
* - `MINIMAP_PADDING_PX` — inner margin kept clear around the fitted scene so
|
|
116
136
|
* shapes at the edge aren't clipped. Range: 0–32.
|
|
117
|
-
* - `
|
|
118
|
-
*
|
|
119
|
-
*
|
|
137
|
+
* - `MINIMAP_IDLE_MS` — the overview repaints only once the editor has been
|
|
138
|
+
* quiet for this long: never during a drag / pan / pinch / wheel burst, so
|
|
139
|
+
* the minimap costs nothing while the user is moving things, and once
|
|
140
|
+
* right after. Range: 50–300.
|
|
141
|
+
* - `MINIMAP_BACKGROUND` / `MINIMAP_ELEMENT_COLOR` / `MINIMAP_ELEMENT_OPACITY` —
|
|
142
|
+
* the overview is a schematic: white paper with every element's box in the
|
|
143
|
+
* system accent colour (no real rendering).
|
|
120
144
|
* - `MINIMAP_FRAME_COLOR` / `MINIMAP_FRAME_LINE_WIDTH` — stroke of the current
|
|
121
145
|
* viewport rectangle drawn over the overview.
|
|
122
146
|
* - `MINIMAP_FRAME_FILL` — translucent wash inside the viewport rectangle.
|
|
@@ -128,7 +152,10 @@ export declare const SEARCH_ZOOM_PADDING_PX = 160;
|
|
|
128
152
|
export declare const MINIMAP_WIDTH_PX = 200;
|
|
129
153
|
export declare const MINIMAP_HEIGHT_PX = 150;
|
|
130
154
|
export declare const MINIMAP_PADDING_PX = 8;
|
|
131
|
-
export declare const
|
|
155
|
+
export declare const MINIMAP_IDLE_MS = 120;
|
|
156
|
+
export declare const MINIMAP_BACKGROUND = "#ffffff";
|
|
157
|
+
export declare const MINIMAP_ELEMENT_COLOR: string;
|
|
158
|
+
export declare const MINIMAP_ELEMENT_OPACITY = 0.55;
|
|
132
159
|
/** Viewport frame on the minimap — the shared chrome accent (iris9). */
|
|
133
160
|
export declare const MINIMAP_FRAME_COLOR: string;
|
|
134
161
|
export declare const MINIMAP_FRAME_LINE_WIDTH = 1.5;
|
|
@@ -149,4 +176,29 @@ export declare const TEXT_FONT_STACKS: readonly {
|
|
|
149
176
|
export declare const DRAWING_PANEL_WIDTH = 176;
|
|
150
177
|
export declare const BRUSH_WIDTH_MIN = 1;
|
|
151
178
|
export declare const BRUSH_WIDTH_MAX = 40;
|
|
179
|
+
/**
|
|
180
|
+
* Quick-pick emoji shared by the emoji-element picker and the sticky
|
|
181
|
+
* reaction bar. Order is display order.
|
|
182
|
+
*/
|
|
183
|
+
export declare const EMOJI_QUICK_PICKS: readonly string[];
|
|
184
|
+
/**
|
|
185
|
+
* How long the viewport must stay still before canvas-anchored DOM
|
|
186
|
+
* overlays (link badges, sticky reactions) reappear after a pan/zoom.
|
|
187
|
+
* Reasonable range 80–300 ms.
|
|
188
|
+
*/
|
|
189
|
+
export declare const VIEWPORT_QUIET_MS = 150;
|
|
190
|
+
/**
|
|
191
|
+
* How long after an element gesture (move / resize / rotate) ends before
|
|
192
|
+
* the floating selection toolbar reappears. During the gesture the
|
|
193
|
+
* toolbar is hidden entirely — repositioning it (floating-ui
|
|
194
|
+
* autoUpdate + React re-render) on every frame of a drag costs more
|
|
195
|
+
* than the whole canvas repaint. Reasonable range 100–400 ms.
|
|
196
|
+
*/
|
|
197
|
+
export declare const GESTURE_QUIET_MS = 100;
|
|
198
|
+
/**
|
|
199
|
+
* Default corner radius for a freshly applied rounded-rect image mask,
|
|
200
|
+
* as a fraction of the shorter box side (0..0.5). The mask popover's
|
|
201
|
+
* slider adjusts it per shape afterwards.
|
|
202
|
+
*/
|
|
203
|
+
export declare const IMAGE_MASK_DEFAULT_RADIUS = 0.2;
|
|
152
204
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,sDAA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;;;GAMG;AACH,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC"}
|
|
@@ -17,18 +17,39 @@ export const PALETTE_WIDTH = 200;
|
|
|
17
17
|
export const PALETTE_ITEM_SIZE = 28;
|
|
18
18
|
/** Width of the right property panel, in CSS pixels. */
|
|
19
19
|
export const PROPERTY_PANEL_WIDTH = 240;
|
|
20
|
+
/**
|
|
21
|
+
* Lucide icon sizing — one set for the whole chrome so a 40-px control, a
|
|
22
|
+
* menu row and a chip all read at the same weight, and every glyph lands
|
|
23
|
+
* on the pixel grid. Lucide draws on a 24-unit grid with a 2-unit stroke:
|
|
24
|
+
* only whole multiples keep that geometry on device pixels — 24 (1:1) and
|
|
25
|
+
* 12 (×½, stroke 2 → 1-px lines). Any other size (20, 16, 14 …) scales the
|
|
26
|
+
* grid fractionally and every edge lands between pixels, which reads
|
|
27
|
+
* blurry at 1× and 2× alike.
|
|
28
|
+
* - `CONTROL_ICON` — glyph inside a 40-px control (toolbar buttons, the
|
|
29
|
+
* selection panel, panel headers, dialog buttons): 24 / 2.
|
|
30
|
+
* - `ROW_ICON` — leading icon of a menu / list row (24-px gutter): 20 / 2 —
|
|
31
|
+
* a step below the controls by design; the ×⅚ scale costs a little
|
|
32
|
+
* crispness, the trade the menus make for a lighter row.
|
|
33
|
+
* - `MARK_ICON` — check / chevron marks: 12 / 2.
|
|
34
|
+
* - `BADGE_ICON` — tiny glyphs inside chips and badges: 12 / 2.
|
|
35
|
+
*/
|
|
36
|
+
const CONTROL_ICON_SIZE = 24;
|
|
37
|
+
const CONTROL_ICON_STROKE = 2;
|
|
38
|
+
const ROW_ICON_SIZE = 20;
|
|
39
|
+
const ROW_ICON_STROKE = 2;
|
|
40
|
+
const MARK_ICON_SIZE = 12;
|
|
41
|
+
const MARK_ICON_STROKE = 2;
|
|
42
|
+
const BADGE_ICON_SIZE = 12;
|
|
43
|
+
const BADGE_ICON_STROKE = 2;
|
|
44
|
+
/** Drop glyph in the centre of the file-drop overlay. */
|
|
45
|
+
export const DROP_OVERLAY_ICON_SIZE = 48;
|
|
46
|
+
export const ICON_STROKE = 2;
|
|
47
|
+
export const CONTROL_ICON = { size: CONTROL_ICON_SIZE, strokeWidth: CONTROL_ICON_STROKE };
|
|
48
|
+
export const ROW_ICON = { size: ROW_ICON_SIZE, strokeWidth: ROW_ICON_STROKE };
|
|
49
|
+
export const MARK_ICON = { size: MARK_ICON_SIZE, strokeWidth: MARK_ICON_STROKE };
|
|
50
|
+
export const BADGE_ICON = { size: BADGE_ICON_SIZE, strokeWidth: BADGE_ICON_STROKE };
|
|
20
51
|
/** Pixel side of the colour swatches inside the property panel. */
|
|
21
52
|
export const PROPERTY_SWATCH_SIZE = 12;
|
|
22
|
-
/** Width of the layer panel, in CSS pixels. */
|
|
23
|
-
export const LAYER_PANEL_WIDTH = 220;
|
|
24
|
-
/** Pixel side of the toggle icon (visibility / lock) buttons. */
|
|
25
|
-
export const LAYER_TOGGLE_ICON_SIZE = 20;
|
|
26
|
-
/** Pixel side of the per-row colour swatch in the layer panel. */
|
|
27
|
-
export const LAYER_SWATCH_SIZE = 22;
|
|
28
|
-
/** Width of the comments popover, in CSS pixels. */
|
|
29
|
-
export const COMMENTS_PANEL_WIDTH = 280;
|
|
30
|
-
/** Pixel height of the toolbar vertical separator. */
|
|
31
|
-
export const TOOLBAR_SEPARATOR_HEIGHT = 20;
|
|
32
53
|
/**
|
|
33
54
|
* Default auto-dismiss time for a toast (ms). 0 / Infinity keep it
|
|
34
55
|
* open until the user clicks the × — useful for sticky errors.
|
|
@@ -89,6 +110,17 @@ export const SELECTION_PANEL_EDGE_INSET_BOTTOM_PX = 66;
|
|
|
89
110
|
/** Inset from the LEFT edge — small margin (no left-docked chrome by default). */
|
|
90
111
|
export const SELECTION_PANEL_EDGE_INSET_LEFT_PX = 16;
|
|
91
112
|
export const POPOVER_OFFSET_PX = 6;
|
|
113
|
+
/** Minimum distance a popover keeps from the viewport edges (px). Range: 4–16. */
|
|
114
|
+
export const POPOVER_VIEWPORT_PADDING_PX = 6;
|
|
115
|
+
/**
|
|
116
|
+
* Minimum distance the context menu (and its submenus) keeps from the
|
|
117
|
+
* viewport edges — matches the side inset of the static toolbars, so a menu
|
|
118
|
+
* pushed against an edge lines up with the docked chrome. The menu is
|
|
119
|
+
* clamped to the WINDOW, not the canvas: it may overhang an embedded
|
|
120
|
+
* canvas, and when the window is shorter than the menu it scrolls.
|
|
121
|
+
* Range: 8–24.
|
|
122
|
+
*/
|
|
123
|
+
export const MENU_VIEWPORT_PADDING_PX = 16;
|
|
92
124
|
/**
|
|
93
125
|
* Text contextual-panel controls.
|
|
94
126
|
*
|
|
@@ -122,9 +154,13 @@ export const SEARCH_ZOOM_PADDING_PX = 160;
|
|
|
122
154
|
* - `MINIMAP_WIDTH_PX` / `MINIMAP_HEIGHT_PX` — default canvas size in CSS px.
|
|
123
155
|
* - `MINIMAP_PADDING_PX` — inner margin kept clear around the fitted scene so
|
|
124
156
|
* shapes at the edge aren't clipped. Range: 0–32.
|
|
125
|
-
* - `
|
|
126
|
-
*
|
|
127
|
-
*
|
|
157
|
+
* - `MINIMAP_IDLE_MS` — the overview repaints only once the editor has been
|
|
158
|
+
* quiet for this long: never during a drag / pan / pinch / wheel burst, so
|
|
159
|
+
* the minimap costs nothing while the user is moving things, and once
|
|
160
|
+
* right after. Range: 50–300.
|
|
161
|
+
* - `MINIMAP_BACKGROUND` / `MINIMAP_ELEMENT_COLOR` / `MINIMAP_ELEMENT_OPACITY` —
|
|
162
|
+
* the overview is a schematic: white paper with every element's box in the
|
|
163
|
+
* system accent colour (no real rendering).
|
|
128
164
|
* - `MINIMAP_FRAME_COLOR` / `MINIMAP_FRAME_LINE_WIDTH` — stroke of the current
|
|
129
165
|
* viewport rectangle drawn over the overview.
|
|
130
166
|
* - `MINIMAP_FRAME_FILL` — translucent wash inside the viewport rectangle.
|
|
@@ -136,7 +172,10 @@ export const SEARCH_ZOOM_PADDING_PX = 160;
|
|
|
136
172
|
export const MINIMAP_WIDTH_PX = 200;
|
|
137
173
|
export const MINIMAP_HEIGHT_PX = 150;
|
|
138
174
|
export const MINIMAP_PADDING_PX = 8;
|
|
139
|
-
export const
|
|
175
|
+
export const MINIMAP_IDLE_MS = 120;
|
|
176
|
+
export const MINIMAP_BACKGROUND = "#ffffff";
|
|
177
|
+
export const MINIMAP_ELEMENT_COLOR = UI_ACCENT.light.accent;
|
|
178
|
+
export const MINIMAP_ELEMENT_OPACITY = 0.55;
|
|
140
179
|
/** Viewport frame on the minimap — the shared chrome accent (iris9). */
|
|
141
180
|
export const MINIMAP_FRAME_COLOR = UI_ACCENT.light.accent;
|
|
142
181
|
export const MINIMAP_FRAME_LINE_WIDTH = 1.5;
|
|
@@ -162,4 +201,50 @@ export const TEXT_FONT_STACKS = [
|
|
|
162
201
|
export const DRAWING_PANEL_WIDTH = 176;
|
|
163
202
|
export const BRUSH_WIDTH_MIN = 1;
|
|
164
203
|
export const BRUSH_WIDTH_MAX = 40;
|
|
204
|
+
/**
|
|
205
|
+
* Quick-pick emoji shared by the emoji-element picker and the sticky
|
|
206
|
+
* reaction bar. Order is display order.
|
|
207
|
+
*/
|
|
208
|
+
export const EMOJI_QUICK_PICKS = [
|
|
209
|
+
"😀",
|
|
210
|
+
"😂",
|
|
211
|
+
"😍",
|
|
212
|
+
"🤔",
|
|
213
|
+
"😎",
|
|
214
|
+
"🙌",
|
|
215
|
+
"👍",
|
|
216
|
+
"👎",
|
|
217
|
+
"👏",
|
|
218
|
+
"🔥",
|
|
219
|
+
"❤️",
|
|
220
|
+
"💡",
|
|
221
|
+
"⭐",
|
|
222
|
+
"✅",
|
|
223
|
+
"❌",
|
|
224
|
+
"⚠️",
|
|
225
|
+
"❓",
|
|
226
|
+
"🎉",
|
|
227
|
+
"🚀",
|
|
228
|
+
"👀",
|
|
229
|
+
];
|
|
230
|
+
/**
|
|
231
|
+
* How long the viewport must stay still before canvas-anchored DOM
|
|
232
|
+
* overlays (link badges, sticky reactions) reappear after a pan/zoom.
|
|
233
|
+
* Reasonable range 80–300 ms.
|
|
234
|
+
*/
|
|
235
|
+
export const VIEWPORT_QUIET_MS = 150;
|
|
236
|
+
/**
|
|
237
|
+
* How long after an element gesture (move / resize / rotate) ends before
|
|
238
|
+
* the floating selection toolbar reappears. During the gesture the
|
|
239
|
+
* toolbar is hidden entirely — repositioning it (floating-ui
|
|
240
|
+
* autoUpdate + React re-render) on every frame of a drag costs more
|
|
241
|
+
* than the whole canvas repaint. Reasonable range 100–400 ms.
|
|
242
|
+
*/
|
|
243
|
+
export const GESTURE_QUIET_MS = 100;
|
|
244
|
+
/**
|
|
245
|
+
* Default corner radius for a freshly applied rounded-rect image mask,
|
|
246
|
+
* as a fraction of the shorter box side (0..0.5). The mask popover's
|
|
247
|
+
* slider adjusts it per shape afterwards.
|
|
248
|
+
*/
|
|
249
|
+
export const IMAGE_MASK_DEFAULT_RADIUS = 0.2;
|
|
165
250
|
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC,sDAAsD;AACtD,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AAEjC,uEAAuE;AACvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAEpC,wDAAwD;AACxD,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAExC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,eAAe,GAAG,CAA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AC;AAErC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/core/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/F,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAoBnE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAED,mDAAmD;AACnD,eAAO,MAAM,eAAe,GAAI,sBAAsB,oBAAoB,4CAEzE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,wCAAiB,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAO,MASpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,QAAO,MAAM,GAAG,IAAkC,CAAC;AAEzF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,EACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,EAC7B,cAAc,CAAC;AACf;;;;;;GAMG;AACH,QAAQ,MAAM,YAAY,KACzB,CA+BF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/core/context.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAG/F;;;;;;;;;;;;;;;GAeG;AACH,MAAM,cAAc,GAAG,aAAa,CAAgB,IAAI,CAAC,CAAC;AAO1D,mDAA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F,sEAAsE;AACtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAwB,EAAE,CAC7D,iBAAiB,CAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;AAE5E,oEAAoE;AACpE,MAAM,CAAC,MAAM,eAAe,GAAG,GAAkB,EAAE,CACjD,iBAAiB,CAAgB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal-container.d.ts","sourceRoot":"","sources":["../../src/core/portal-container.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAclE,eAAO,MAAM,uBAAuB,GAAI,0BAGrC;IACD,QAAQ,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B,4CAEA,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,QAAO,WACe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal-container.js","sourceRoot":"","sources":["../../src/core/portal-container.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AAElE;;;;;;;;;GASG;AACH,MAAM,sBAAsB,GAAG,aAAa,CAAqB,IAAI,CAAC,CAAC;AAEvE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EACtC,SAAS,EACT,QAAQ,GAIT,EAAE,EAAE,CAAC,CACJ,KAAC,sBAAsB,CAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,YAAG,QAAQ,GAAmC,CAChG,CAAC;AAEF,yEAAyE;AACzE,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAgB,EAAE,CAClD,UAAU,CAAC,sBAAsB,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Browser fullscreen for one element: `active` mirrors
|
|
4
|
+
* `document.fullscreenElement`, `toggle` enters fullscreen on the ref's
|
|
5
|
+
* element or exits. `supported` is `false` where the Fullscreen API is
|
|
6
|
+
* missing (older iOS Safari, sandboxed frames) so hosts can hide the
|
|
7
|
+
* control. Never throws — a rejected request just leaves `active` false.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useFullscreen: (ref: RefObject<HTMLElement | null>) => {
|
|
10
|
+
readonly active: boolean;
|
|
11
|
+
readonly supported: boolean;
|
|
12
|
+
readonly toggle: () => void;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=use-fullscreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-fullscreen.d.ts","sourceRoot":"","sources":["../../src/core/use-fullscreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GACxB,KAAK,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,KACjC;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAA;CA0BtF,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Browser fullscreen for one element: `active` mirrors
|
|
4
|
+
* `document.fullscreenElement`, `toggle` enters fullscreen on the ref's
|
|
5
|
+
* element or exits. `supported` is `false` where the Fullscreen API is
|
|
6
|
+
* missing (older iOS Safari, sandboxed frames) so hosts can hide the
|
|
7
|
+
* control. Never throws — a rejected request just leaves `active` false.
|
|
8
|
+
*/
|
|
9
|
+
export const useFullscreen = (ref) => {
|
|
10
|
+
const supported = typeof document !== "undefined" && typeof document.exitFullscreen === "function";
|
|
11
|
+
const [active, setActive] = useState(false);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (!supported)
|
|
14
|
+
return undefined;
|
|
15
|
+
const sync = () => {
|
|
16
|
+
const el = ref.current;
|
|
17
|
+
setActive(el !== null && document.fullscreenElement === el);
|
|
18
|
+
};
|
|
19
|
+
sync();
|
|
20
|
+
document.addEventListener("fullscreenchange", sync);
|
|
21
|
+
return () => {
|
|
22
|
+
document.removeEventListener("fullscreenchange", sync);
|
|
23
|
+
};
|
|
24
|
+
}, [ref, supported]);
|
|
25
|
+
const toggle = useCallback(() => {
|
|
26
|
+
if (!supported)
|
|
27
|
+
return;
|
|
28
|
+
const el = ref.current;
|
|
29
|
+
if (document.fullscreenElement) {
|
|
30
|
+
void document.exitFullscreen().catch(() => undefined);
|
|
31
|
+
}
|
|
32
|
+
else if (el && typeof el.requestFullscreen === "function") {
|
|
33
|
+
void el.requestFullscreen().catch(() => undefined);
|
|
34
|
+
}
|
|
35
|
+
}, [ref, supported]);
|
|
36
|
+
return { active, supported, toggle };
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=use-fullscreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-fullscreen.js","sourceRoot":"","sources":["../../src/core/use-fullscreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,GAAkC,EACsD,EAAE;IAC1F,MAAM,SAAS,GACb,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,QAAQ,CAAC,cAAc,KAAK,UAAU,CAAC;IACnF,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK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* `true` while no element gesture (move / resize / rotate — anything
|
|
4
|
+
* running through the editor's gesture transaction or element drag — or
|
|
5
|
+
* a library drag-to-place) is active, plus a `GESTURE_QUIET_MS` settle delay after it ends. The
|
|
6
|
+
* floating selection toolbar hides while this is `false`: repositioning
|
|
7
|
+
* it (floating-ui autoUpdate + a React re-render of the whole property
|
|
8
|
+
* toolbar) on every frame of a drag makes the element visibly lag.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useQuietGesture: (editor: Editor | null) => boolean;
|
|
11
|
+
//# sourceMappingURL=use-quiet-gesture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-quiet-gesture.d.ts","sourceRoot":"","sources":["../../src/core/use-quiet-gesture.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGrD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,GAAG,IAAI,KAAG,OA8CvD,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { GESTURE_QUIET_MS } from "./constants.js";
|
|
3
|
+
/**
|
|
4
|
+
* `true` while no element gesture (move / resize / rotate — anything
|
|
5
|
+
* running through the editor's gesture transaction or element drag — or
|
|
6
|
+
* a library drag-to-place) is active, plus a `GESTURE_QUIET_MS` settle delay after it ends. The
|
|
7
|
+
* floating selection toolbar hides while this is `false`: repositioning
|
|
8
|
+
* it (floating-ui autoUpdate + a React re-render of the whole property
|
|
9
|
+
* toolbar) on every frame of a drag makes the element visibly lag.
|
|
10
|
+
*/
|
|
11
|
+
export const useQuietGesture = (editor) => {
|
|
12
|
+
const [quiet, setQuiet] = useState(true);
|
|
13
|
+
const quietRef = useRef(true);
|
|
14
|
+
const timer = useRef(null);
|
|
15
|
+
// Scene identity at gesture start. A press alone (`dragElementId` is
|
|
16
|
+
// set on pointer-DOWN) must not hide the toolbar — a plain
|
|
17
|
+
// click-select would blink it. Only a gesture that actually CHANGED
|
|
18
|
+
// the scene (moved / resized / rotated something) counts.
|
|
19
|
+
const gestureBaseScene = useRef(null);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!editor)
|
|
22
|
+
return undefined;
|
|
23
|
+
const off = editor.on("change", () => {
|
|
24
|
+
// A library placement is a drag from its first frame — no press-only
|
|
25
|
+
// phase to wait out, hide at once.
|
|
26
|
+
const placing = editor.placementId !== null;
|
|
27
|
+
const active = placing || editor.gestureTx !== null || editor.dragElementId !== null;
|
|
28
|
+
if (active) {
|
|
29
|
+
gestureBaseScene.current ??= editor.scene;
|
|
30
|
+
if (!placing && editor.scene === gestureBaseScene.current)
|
|
31
|
+
return; // press, no movement yet
|
|
32
|
+
if (timer.current !== null) {
|
|
33
|
+
clearTimeout(timer.current);
|
|
34
|
+
timer.current = null;
|
|
35
|
+
}
|
|
36
|
+
if (quietRef.current) {
|
|
37
|
+
quietRef.current = false;
|
|
38
|
+
setQuiet(false);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else if (gestureBaseScene.current !== null || !quietRef.current) {
|
|
42
|
+
gestureBaseScene.current = null;
|
|
43
|
+
if (quietRef.current || timer.current !== null)
|
|
44
|
+
return;
|
|
45
|
+
// Gesture over — reappear after the settle delay.
|
|
46
|
+
timer.current = setTimeout(() => {
|
|
47
|
+
timer.current = null;
|
|
48
|
+
quietRef.current = true;
|
|
49
|
+
setQuiet(true);
|
|
50
|
+
}, GESTURE_QUIET_MS);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return () => {
|
|
54
|
+
off();
|
|
55
|
+
if (timer.current !== null)
|
|
56
|
+
clearTimeout(timer.current);
|
|
57
|
+
};
|
|
58
|
+
}, [editor]);
|
|
59
|
+
return quiet;
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=use-quiet-gesture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-quiet-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5B,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;gBACvB,CAAC;gBACD,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;oBACrB,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;oBACzB,QAAQ,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;YACH,CAAC;iBAAM,IAAI,gBAAgB,CAAC,OAAO,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;gBAClE,gBAAgB,CAAC,OAAO,GAAG,IAAI,CAAC;gBAChC,IAAI,QAAQ,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;oBAAE,OAAO;gBACvD,kDAAkD;gBAClD,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;oBAC9B,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;oBACrB,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;oBACxB,QAAQ,CAAC,IAAI,CAAC,CAAC;gBACjB,CAAC,EAAE,gBAAgB,CAAC,CAAC;YACvB,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE;YACV,GAAG,EAAE,CAAC;YACN,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;gBAAE,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Editor } from "@oh-just-another/state";
|
|
2
|
+
/**
|
|
3
|
+
* `true` while the viewport has been still for `VIEWPORT_QUIET_MS`.
|
|
4
|
+
* DOM overlays anchored to canvas coordinates (link badges, sticky
|
|
5
|
+
* reactions) hide while this is `false`: re-rendering them on every
|
|
6
|
+
* pan/zoom frame made React reconciliation a per-frame cost on the main
|
|
7
|
+
* thread. They pop back in as soon as the camera settles.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useQuietViewport: (editor: Editor | null) => boolean;
|
|
10
|
+
//# sourceMappingURL=use-quiet-viewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-quiet-viewport.d.ts","sourceRoot":"","sources":["../../src/core/use-quiet-viewport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGrD;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,GAAG,IAAI,KAAG,OA0BxD,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { VIEWPORT_QUIET_MS } from "./constants.js";
|
|
3
|
+
/**
|
|
4
|
+
* `true` while the viewport has been still for `VIEWPORT_QUIET_MS`.
|
|
5
|
+
* DOM overlays anchored to canvas coordinates (link badges, sticky
|
|
6
|
+
* reactions) hide while this is `false`: re-rendering them on every
|
|
7
|
+
* pan/zoom frame made React reconciliation a per-frame cost on the main
|
|
8
|
+
* thread. They pop back in as soon as the camera settles.
|
|
9
|
+
*/
|
|
10
|
+
export const useQuietViewport = (editor) => {
|
|
11
|
+
const [quiet, setQuiet] = useState(true);
|
|
12
|
+
const last = useRef(null);
|
|
13
|
+
const timer = useRef(null);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (!editor)
|
|
16
|
+
return undefined;
|
|
17
|
+
const off = editor.on("change", () => {
|
|
18
|
+
const v = editor.scene.viewport;
|
|
19
|
+
const prev = last.current;
|
|
20
|
+
last.current = { x: v.pan.x, y: v.pan.y, zoom: v.zoom };
|
|
21
|
+
if (prev?.x === v.pan.x && prev.y === v.pan.y && prev.zoom === v.zoom)
|
|
22
|
+
return;
|
|
23
|
+
if (prev === null)
|
|
24
|
+
return; // first observation — nothing moved yet
|
|
25
|
+
setQuiet(false);
|
|
26
|
+
if (timer.current !== null)
|
|
27
|
+
clearTimeout(timer.current);
|
|
28
|
+
timer.current = setTimeout(() => {
|
|
29
|
+
setQuiet(true);
|
|
30
|
+
}, VIEWPORT_QUIET_MS);
|
|
31
|
+
});
|
|
32
|
+
return () => {
|
|
33
|
+
off();
|
|
34
|
+
if (timer.current !== null)
|
|
35
|
+
clearTimeout(timer.current);
|
|
36
|
+
};
|
|
37
|
+
}, [editor]);
|
|
38
|
+
return quiet;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=use-quiet-viewport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-quiet-viewport.js","sourceRoot":"","sources":["../../src/core/use-quiet-viewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAqB,EAAW,EAAE;IACjE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,MAAM,CAAgD,IAAI,CAAC,CAAC;IACzE,MAAM,KAAK,GAAG,MAAM,CAAuC,IAAI,CAAC,CAAC;IAEjE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM;YAAE,OAAO,SAAS,CAAC;QAC9B,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;YACnC,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;YAChC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC;YAC1B,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,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