@gravity-ui/markdown-editor 15.19.1 → 15.20.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/build/cjs/bundle/config/action-names.d.ts +1 -1
- package/build/cjs/bundle/wysiwyg-preset.js +5 -1
- package/build/cjs/bundle/wysiwyg-preset.js.map +1 -1
- package/build/cjs/extensions/yfm/YfmTable/index.d.ts +15 -1
- package/build/cjs/extensions/yfm/YfmTable/index.js +4 -2
- package/build/cjs/extensions/yfm/YfmTable/index.js.map +1 -1
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.d.ts +6 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.js +5 -8
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.js.map +1 -1
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/clear-cells.d.ts +7 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/clear-cells.js +41 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/clear-cells.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/insert-empty-column.d.ts +6 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/insert-empty-column.js +59 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/insert-empty-column.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/insert-empty-row.d.ts +6 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/insert-empty-row.js +54 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/insert-empty-row.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/remove-column-range.d.ts +6 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/remove-column-range.js +77 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/remove-column-range.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/remove-row-range.d.ts +6 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/remove-row-range.js +74 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/remove-row-range.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenu/FloatingMenu.d.ts +10 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenu/FloatingMenu.js +45 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenu/FloatingMenu.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenu/index.d.ts +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenu/index.js +5 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenu/index.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenuControl/FloatingMenuControl.d.ts +15 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenuControl/FloatingMenuControl.js +67 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenuControl/FloatingMenuControl.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenuControl/index.d.ts +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenuControl/index.js +5 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenuControl/index.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/FloatingPlusButton.d.ts +4 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/FloatingPlusButton.js +26 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/FloatingPlusButton.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/InsertCursor.d.ts +6 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/InsertCursor.js +68 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/InsertCursor.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/PlusButton.d.ts +6 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/PlusButton.js +26 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/PlusButton.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/index.d.ts +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/index.js +5 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/index.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusControl/FloatingPlusControl.d.ts +9 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusControl/FloatingPlusControl.js +38 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusControl/FloatingPlusControl.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusControl/index.d.ts +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusControl/index.js +5 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusControl/index.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/FloatingPopup.css +14 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/FloatingPopup.d.ts +13 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/FloatingPopup.js +58 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/FloatingPopup.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/index.d.ts +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/index.js +5 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/index.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/const.d.ts +13 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/const.js +18 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/const.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd/dnd-drop-cursor.d.ts +36 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd/dnd-drop-cursor.js +144 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd/dnd-drop-cursor.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd/dnd.css +19 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd/dnd.d.ts +31 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd/dnd.js +467 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd/dnd.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/index.d.ts +12 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/index.js +11 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/index.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/nodeviews/yfm-table-cell-view.d.ts +6 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/nodeviews/yfm-table-cell-view.js +288 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/nodeviews/yfm-table-cell-view.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/nodeviews/yfm-table-view.css +4 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/nodeviews/yfm-table-view.d.ts +3 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/nodeviews/yfm-table-view.js +100 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/nodeviews/yfm-table-view.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/plugins/dnd-plugin.d.ts +23 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/plugins/dnd-plugin.js +119 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/plugins/dnd-plugin.js.map +1 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/plugins/focus-plugin.d.ts +17 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/plugins/focus-plugin.js +158 -0
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/plugins/focus-plugin.js.map +1 -0
- package/build/cjs/i18n/yfm-table/en.json +3 -0
- package/build/cjs/i18n/yfm-table/index.d.ts +4 -1
- package/build/cjs/i18n/yfm-table/ru.json +3 -0
- package/build/cjs/icons/index.d.ts +2 -5
- package/build/cjs/icons/index.js +5 -8
- package/build/cjs/icons/index.js.map +1 -1
- package/build/cjs/lodash.d.ts +3 -1
- package/build/cjs/lodash.js +5 -1
- package/build/cjs/lodash.js.map +1 -1
- package/build/cjs/table-utils/table-desc.d.ts +50 -6
- package/build/cjs/table-utils/table-desc.js +196 -3
- package/build/cjs/table-utils/table-desc.js.map +1 -1
- package/build/cjs/toolbar/ToolbarButtonPopup.js +2 -2
- package/build/cjs/toolbar/ToolbarButtonPopup.js.map +1 -1
- package/build/cjs/toolbar/ToolbarListButton.js +1 -1
- package/build/cjs/toolbar/ToolbarListButton.js.map +1 -1
- package/build/cjs/version.js +1 -1
- package/build/cjs/version.js.map +1 -1
- package/build/esm/bundle/config/action-names.d.ts +1 -1
- package/build/esm/bundle/wysiwyg-preset.js +5 -1
- package/build/esm/bundle/wysiwyg-preset.js.map +1 -1
- package/build/esm/extensions/yfm/YfmTable/index.d.ts +15 -1
- package/build/esm/extensions/yfm/YfmTable/index.js +4 -2
- package/build/esm/extensions/yfm/YfmTable/index.js.map +1 -1
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.d.ts +7 -1
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.js +2 -6
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/actions.js.map +1 -1
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/clear-cells.d.ts +7 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/clear-cells.js +37 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/clear-cells.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/insert-empty-column.d.ts +6 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/insert-empty-column.js +55 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/insert-empty-column.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/insert-empty-row.d.ts +6 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/insert-empty-row.js +50 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/insert-empty-row.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/remove-column-range.d.ts +6 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/remove-column-range.js +73 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/remove-column-range.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/remove-row-range.d.ts +6 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/remove-row-range.js +70 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/commands/remove-row-range.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenu/FloatingMenu.d.ts +10 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenu/FloatingMenu.js +41 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenu/FloatingMenu.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenu/index.d.ts +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenu/index.js +2 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenu/index.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenuControl/FloatingMenuControl.d.ts +15 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenuControl/FloatingMenuControl.js +63 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenuControl/FloatingMenuControl.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenuControl/index.d.ts +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenuControl/index.js +2 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenuControl/index.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/FloatingPlusButton.d.ts +4 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/FloatingPlusButton.js +22 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/FloatingPlusButton.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/InsertCursor.d.ts +6 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/InsertCursor.js +64 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/InsertCursor.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/PlusButton.d.ts +6 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/PlusButton.js +22 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/PlusButton.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/index.d.ts +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/index.js +2 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/index.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusControl/FloatingPlusControl.d.ts +9 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusControl/FloatingPlusControl.js +35 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusControl/FloatingPlusControl.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusControl/index.d.ts +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusControl/index.js +2 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusControl/index.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/FloatingPopup.css +14 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/FloatingPopup.d.ts +13 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/FloatingPopup.js +54 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/FloatingPopup.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/index.d.ts +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/index.js +2 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/index.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/const.d.ts +13 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/const.js +15 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/const.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd/dnd-drop-cursor.d.ts +36 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd/dnd-drop-cursor.js +139 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd/dnd-drop-cursor.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd/dnd.css +19 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd/dnd.d.ts +31 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd/dnd.js +463 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd/dnd.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/index.d.ts +12 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/index.js +7 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/index.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/nodeviews/yfm-table-cell-view.d.ts +6 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/nodeviews/yfm-table-cell-view.js +284 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/nodeviews/yfm-table-cell-view.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/nodeviews/yfm-table-view.css +4 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/nodeviews/yfm-table-view.d.ts +3 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/nodeviews/yfm-table-view.js +96 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/nodeviews/yfm-table-view.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/plugins/dnd-plugin.d.ts +23 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/plugins/dnd-plugin.js +108 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/plugins/dnd-plugin.js.map +1 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/plugins/focus-plugin.d.ts +17 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/plugins/focus-plugin.js +153 -0
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/plugins/focus-plugin.js.map +1 -0
- package/build/esm/i18n/yfm-table/en.json +3 -0
- package/build/esm/i18n/yfm-table/index.d.ts +4 -1
- package/build/esm/i18n/yfm-table/ru.json +3 -0
- package/build/esm/icons/index.d.ts +2 -5
- package/build/esm/icons/index.js +4 -7
- package/build/esm/icons/index.js.map +1 -1
- package/build/esm/lodash.d.ts +3 -1
- package/build/esm/lodash.js +3 -1
- package/build/esm/lodash.js.map +1 -1
- package/build/esm/table-utils/table-desc.d.ts +50 -6
- package/build/esm/table-utils/table-desc.js +196 -3
- package/build/esm/table-utils/table-desc.js.map +1 -1
- package/build/esm/toolbar/ToolbarButtonPopup.js +2 -2
- package/build/esm/toolbar/ToolbarButtonPopup.js.map +1 -1
- package/build/esm/toolbar/ToolbarListButton.js +1 -1
- package/build/esm/toolbar/ToolbarListButton.js.map +1 -1
- package/build/esm/version.js +1 -1
- package/build/esm/version.js.map +1 -1
- package/build/styles.css +31 -116
- package/package.json +1 -1
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/buttons.d.ts +0 -14
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/buttons.js +0 -97
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/buttons.js.map +0 -1
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/view.css +0 -85
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/view.d.ts +0 -4
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/view.js +0 -62
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/view.js.map +0 -1
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/yfmTableCellView.css +0 -37
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/yfmTableCellView.d.ts +0 -4
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/yfmTableCellView.js +0 -212
- package/build/cjs/extensions/yfm/YfmTable/plugins/YfmTableControls/yfmTableCellView.js.map +0 -1
- package/build/cjs/icons/Mermaid.d.ts +0 -3
- package/build/cjs/icons/Mermaid.js +0 -11
- package/build/cjs/icons/Mermaid.js.map +0 -1
- package/build/cjs/icons/Mono.d.ts +0 -3
- package/build/cjs/icons/Mono.js +0 -6
- package/build/cjs/icons/Mono.js.map +0 -1
- package/build/cjs/icons/Tabs.d.ts +0 -3
- package/build/cjs/icons/Tabs.js +0 -6
- package/build/cjs/icons/Tabs.js.map +0 -1
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/buttons.d.ts +0 -14
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/buttons.js +0 -95
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/buttons.js.map +0 -1
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/view.css +0 -85
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/view.d.ts +0 -4
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/view.js +0 -58
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/view.js.map +0 -1
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/yfmTableCellView.css +0 -37
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/yfmTableCellView.d.ts +0 -4
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/yfmTableCellView.js +0 -208
- package/build/esm/extensions/yfm/YfmTable/plugins/YfmTableControls/yfmTableCellView.js.map +0 -1
- package/build/esm/icons/Mermaid.d.ts +0 -3
- package/build/esm/icons/Mermaid.js +0 -9
- package/build/esm/icons/Mermaid.js.map +0 -1
- package/build/esm/icons/Mono.d.ts +0 -3
- package/build/esm/icons/Mono.js +0 -4
- package/build/esm/icons/Mono.js.map +0 -1
- package/build/esm/icons/Tabs.d.ts +0 -3
- package/build/esm/icons/Tabs.js +0 -4
- package/build/esm/icons/Tabs.js.map +0 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, BroomMotion as ClearCells, TrashBin, Xmark, } from '@gravity-ui/icons';
|
|
4
|
+
import { Icon } from '@gravity-ui/uikit';
|
|
5
|
+
import { i18n } from "../../../../../../../i18n/yfm-table/index.js";
|
|
6
|
+
import { FloatingMenu } from "../FloatingMenu/FloatingMenu.js";
|
|
7
|
+
export const FloatingMenuControl = function YfmTableFloatingMenuControl({ type, multiple, dndHandler, acnhorElement, onMenuOpenToggle, onClearCellsClick, onInsertBeforeClick, onInsertAfterClick, onRemoveRangeClick, onRemoveTableClick, }) {
|
|
8
|
+
const dropdownItems = useMemo(() => [
|
|
9
|
+
[
|
|
10
|
+
{
|
|
11
|
+
text: i18n(`${type}.add.before`),
|
|
12
|
+
qa: `g-md-yfm-table-action-add-${type}-before`,
|
|
13
|
+
action: onInsertBeforeClick,
|
|
14
|
+
iconStart: _jsx(Icon, { data: type === 'row' ? ArrowUp : ArrowLeft }),
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
text: i18n(`${type}.add.after`),
|
|
18
|
+
qa: `g-md-yfm-table-action-add-${type}-after`,
|
|
19
|
+
action: onInsertAfterClick,
|
|
20
|
+
iconStart: _jsx(Icon, { data: type === 'row' ? ArrowDown : ArrowRight }),
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
{
|
|
25
|
+
text: i18n('cells.clear'),
|
|
26
|
+
qa: `g-md-yfm-table-${type}-clear-cells`,
|
|
27
|
+
action: onClearCellsClick,
|
|
28
|
+
iconStart: _jsx(Icon, { data: ClearCells }),
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
{
|
|
33
|
+
text: i18n(`${type}.remove${multiple ? '.multiple' : ''}`),
|
|
34
|
+
qa: `g-md-yfm-table-action-remove-${type}`,
|
|
35
|
+
action: onRemoveRangeClick,
|
|
36
|
+
iconStart: _jsx(Icon, { data: Xmark }),
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
theme: 'danger',
|
|
40
|
+
text: i18n('table.remove'),
|
|
41
|
+
qa: 'g-md-yfm-table-action-remove-table',
|
|
42
|
+
action: onRemoveTableClick,
|
|
43
|
+
iconStart: _jsx(Icon, { data: TrashBin }),
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
], [
|
|
47
|
+
type,
|
|
48
|
+
multiple,
|
|
49
|
+
onClearCellsClick,
|
|
50
|
+
onInsertAfterClick,
|
|
51
|
+
onInsertBeforeClick,
|
|
52
|
+
onRemoveRangeClick,
|
|
53
|
+
onRemoveTableClick,
|
|
54
|
+
]);
|
|
55
|
+
return (_jsx(FloatingMenu, { dirtype: type, canDrag: dndHandler ? dndHandler.canDrag() : false, onOpenToggle: onMenuOpenToggle, anchorElement: acnhorElement, switcherMouseProps: dndHandler
|
|
56
|
+
? {
|
|
57
|
+
onMouseDown: dndHandler.control_handleMouseDown,
|
|
58
|
+
onMouseMove: dndHandler.control_handleMouseMove,
|
|
59
|
+
onMouseUp: dndHandler.control_handleMouseUp,
|
|
60
|
+
}
|
|
61
|
+
: undefined, dropdownItems: dropdownItems }));
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=FloatingMenuControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingMenuControl.js","sourceRoot":"../../../../../../../../../src","sources":["extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenuControl/FloatingMenuControl.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAE9B,OAAO,EACH,SAAS,EACT,SAAS,EACT,UAAU,EACV,OAAO,EACP,WAAW,IAAI,UAAU,EACzB,QAAQ,EACR,KAAK,GACR,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAC,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAC,IAAI,EAAC,qDAA2B;AAGxC,OAAO,EAAC,YAAY,EAAyB,wCAAqC;AAelF,MAAM,CAAC,MAAM,mBAAmB,GAC5B,SAAS,2BAA2B,CAAC,EACjC,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kB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GAAI;aACtC;SACJ;KACyC,EAClD;QACI,IAAI;QACJ,QAAQ;QACR,iBAAiB;QACjB,kBAAkB;QAClB,mBAAmB;QACnB,kBAAkB;QAClB,kBAAkB;KACrB,CACJ,CAAC;IAEF,OAAO,CACH,KAAC,YAAY,IACT,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,EAClD,YAAY,EAAE,gBAAgB,EAC9B,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EACd,UAAU;YACN,CAAC,CAAC;gBACI,WAAW,EAAE,UAAU,CAAC,uBAAuB;gBAC/C,WAAW,EAAE,UAAU,CAAC,uBAAuB;gBAC/C,SAAS,EAAE,UAAU,CAAC,qBAAqB;aAC9C;YACH,CAAC,CAAC,SAAS,EAEnB,aAAa,EAAE,aAAa,GAC9B,CACL,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {useMemo} from 'react';\n\nimport {\n ArrowDown,\n ArrowLeft,\n ArrowRight,\n ArrowUp,\n BroomMotion as ClearCells,\n TrashBin,\n Xmark,\n} from '@gravity-ui/icons';\nimport {Icon} from '@gravity-ui/uikit';\n\nimport {i18n} from 'src/i18n/yfm-table';\n\nimport type {DnDControlHandler} from '../../dnd/dnd';\nimport {FloatingMenu, type FloatingMenuProps} from '../FloatingMenu/FloatingMenu';\n\nexport type FloatingMenuControlProps = {\n acnhorElement: Element;\n multiple: boolean;\n type: FloatingMenuProps['dirtype'];\n dndHandler?: DnDControlHandler;\n onMenuOpenToggle: FloatingMenuProps['onOpenToggle'];\n onClearCellsClick: () => void;\n onInsertBeforeClick: () => void;\n onInsertAfterClick: () => void;\n onRemoveRangeClick: () => void;\n onRemoveTableClick: () => void;\n};\n\nexport const FloatingMenuControl: React.FC<FloatingMenuControlProps> =\n function YfmTableFloatingMenuControl({\n type,\n multiple,\n dndHandler,\n acnhorElement,\n onMenuOpenToggle,\n onClearCellsClick,\n onInsertBeforeClick,\n onInsertAfterClick,\n onRemoveRangeClick,\n onRemoveTableClick,\n }) {\n const dropdownItems = useMemo<FloatingMenuProps['dropdownItems']>(\n () =>\n [\n [\n {\n text: i18n(`${type}.add.before`),\n qa: `g-md-yfm-table-action-add-${type}-before`,\n action: onInsertBeforeClick,\n iconStart: <Icon data={type === 'row' ? ArrowUp : ArrowLeft} />,\n },\n {\n text: i18n(`${type}.add.after`),\n qa: `g-md-yfm-table-action-add-${type}-after`,\n action: onInsertAfterClick,\n iconStart: <Icon data={type === 'row' ? ArrowDown : ArrowRight} />,\n },\n ],\n [\n {\n text: i18n('cells.clear'),\n qa: `g-md-yfm-table-${type}-clear-cells`,\n action: onClearCellsClick,\n iconStart: <Icon data={ClearCells} />,\n },\n ],\n [\n {\n text: i18n(`${type}.remove${multiple ? '.multiple' : ''}`),\n qa: `g-md-yfm-table-action-remove-${type}`,\n action: onRemoveRangeClick,\n iconStart: <Icon data={Xmark} />,\n },\n {\n theme: 'danger',\n text: i18n('table.remove'),\n qa: 'g-md-yfm-table-action-remove-table',\n action: onRemoveTableClick,\n iconStart: <Icon data={TrashBin} />,\n },\n ],\n ] satisfies FloatingMenuProps['dropdownItems'],\n [\n type,\n multiple,\n onClearCellsClick,\n onInsertAfterClick,\n onInsertBeforeClick,\n onRemoveRangeClick,\n onRemoveTableClick,\n ],\n );\n\n return (\n <FloatingMenu\n dirtype={type}\n canDrag={dndHandler ? dndHandler.canDrag() : false}\n onOpenToggle={onMenuOpenToggle}\n anchorElement={acnhorElement}\n switcherMouseProps={\n dndHandler\n ? {\n onMouseDown: dndHandler.control_handleMouseDown,\n onMouseMove: dndHandler.control_handleMouseMove,\n onMouseUp: dndHandler.control_handleMouseUp,\n }\n : undefined\n }\n dropdownItems={dropdownItems}\n />\n );\n };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FloatingMenuControl.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../../../../../../../../../src","sources":["extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingMenuControl/index.ts"],"names":[],"mappings":"AAAA,yCAAsC","sourcesContent":["export * from './FloatingMenuControl';\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type InsertCursorProps } from "./InsertCursor.js";
|
|
2
|
+
import { type PlusButtonProps } from "./PlusButton.js";
|
|
3
|
+
export type FloatingPlusButtonProps = Pick<PlusButtonProps, 'onClick'> & Pick<InsertCursorProps, 'type' | 'anchor'>;
|
|
4
|
+
export declare const FloatingPlusButton: React.FC<FloatingPlusButtonProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { FloatingPopup } from "../FloatingPopup/index.js";
|
|
4
|
+
import { InsertCursor } from "./InsertCursor.js";
|
|
5
|
+
import { PlusButton } from "./PlusButton.js";
|
|
6
|
+
const styles = {
|
|
7
|
+
borderRadius: '100px', // button circle border radius
|
|
8
|
+
background: 'transparent',
|
|
9
|
+
};
|
|
10
|
+
const placementByType = {
|
|
11
|
+
row: 'left-end',
|
|
12
|
+
column: 'top-end',
|
|
13
|
+
};
|
|
14
|
+
const offsetByType = {
|
|
15
|
+
row: { alignmentAxis: -10 },
|
|
16
|
+
column: { alignmentAxis: -10 },
|
|
17
|
+
};
|
|
18
|
+
export const FloatingPlusButton = function YfmTableFloatingPlusButton({ anchor, type, ...btnProps }) {
|
|
19
|
+
const [hovered, setHovered] = useState(false);
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsx(FloatingPopup, { open: true, anchorElement: anchor, placement: placementByType[type], offset: offsetByType[type], style: styles, children: _jsx(PlusButton, { ...btnProps, onHoverChange: setHovered, qa: `g-md-yfm-table-plus-${type}` }) }), hovered && _jsx(InsertCursor, { anchor: anchor, type: type })] }));
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=FloatingPlusButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingPlusButton.js","sourceRoot":"../../../../../../../../../src","sources":["extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/FloatingPlusButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,aAAa,EAA0B,kCAAyB;AAExE,OAAO,EAAC,YAAY,EAAyB,0BAAuB;AACpE,OAAO,EAAC,UAAU,EAAuB,wBAAqB;AAE9D,MAAM,MAAM,GAAwB;IAChC,YAAY,EAAE,OAAO,EAAE,8BAA8B;IACrD,UAAU,EAAE,aAAa;CAC5B,CAAC;AACF,MAAM,eAAe,GAAuE;IACxF,GAAG,EAAE,UAAU;IACf,MAAM,EAAE,SAAS;CACpB,CAAC;AACF,MAAM,YAAY,GAAoE;IAClF,GAAG,EAAE,EAAC,aAAa,EAAE,CAAC,EAAE,EAAC;IACzB,MAAM,EAAE,EAAC,aAAa,EAAE,CAAC,EAAE,EAAC;CAC/B,CAAC;AAKF,MAAM,CAAC,MAAM,kBAAkB,GAC3B,SAAS,0BAA0B,CAAC,EAAC,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,EAAC;IAC3D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,OAAO,CACH,8BACI,KAAC,aAAa,IACV,IAAI,QACJ,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,eAAe,CAAC,IAAI,CAAC,EAChC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,EAC1B,KAAK,EAAE,MAAM,YAEb,KAAC,UAAU,OACH,QAAQ,EACZ,aAAa,EAAE,UAAU,EACzB,EAAE,EAAE,uBAAuB,IAAI,EAAE,GACnC,GACU,EACf,OAAO,IAAI,KAAC,YAAY,IAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAI,IACzD,CACN,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {useState} from 'react';\n\nimport {FloatingPopup, type FloatingPopupProps} from '../FloatingPopup';\n\nimport {InsertCursor, type InsertCursorProps} from './InsertCursor';\nimport {PlusButton, type PlusButtonProps} from './PlusButton';\n\nconst styles: React.CSSProperties = {\n borderRadius: '100px', // button circle border radius\n background: 'transparent',\n};\nconst placementByType: Record<InsertCursorProps['type'], FloatingPopupProps['placement']> = {\n row: 'left-end',\n column: 'top-end',\n};\nconst offsetByType: Record<InsertCursorProps['type'], FloatingPopupProps['offset']> = {\n row: {alignmentAxis: -10},\n column: {alignmentAxis: -10},\n};\n\nexport type FloatingPlusButtonProps = Pick<PlusButtonProps, 'onClick'> &\n Pick<InsertCursorProps, 'type' | 'anchor'>;\n\nexport const FloatingPlusButton: React.FC<FloatingPlusButtonProps> =\n function YfmTableFloatingPlusButton({anchor, type, ...btnProps}) {\n const [hovered, setHovered] = useState(false);\n\n return (\n <>\n <FloatingPopup\n open\n anchorElement={anchor}\n placement={placementByType[type]}\n offset={offsetByType[type]}\n style={styles}\n >\n <PlusButton\n {...btnProps}\n onHoverChange={setHovered}\n qa={`g-md-yfm-table-plus-${type}`}\n />\n </FloatingPopup>\n {hovered && <InsertCursor anchor={anchor} type={type} />}\n </>\n );\n };\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
4
|
+
import { autoUpdate, computePosition } from '@floating-ui/dom';
|
|
5
|
+
import { Portal } from '@gravity-ui/uikit';
|
|
6
|
+
import { useLatest } from 'react-use';
|
|
7
|
+
import { useElementState } from "../../../../../../../react-utils/index.js";
|
|
8
|
+
const placementByType = {
|
|
9
|
+
row: 'bottom-start',
|
|
10
|
+
column: 'right-start',
|
|
11
|
+
};
|
|
12
|
+
export const InsertCursor = function YfmTableInsertCursor({ type, anchor: referenceEl, }) {
|
|
13
|
+
const [floatingEl, setFloatingEl] = useElementState();
|
|
14
|
+
const { width, height, updateRect } = useSize(type, () => referenceEl.getBoundingClientRect());
|
|
15
|
+
const widhtRef = useLatest(width);
|
|
16
|
+
const [floatingStyles, setFloatingStyles] = useState({ top: -9999, left: -9999 });
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (referenceEl && floatingEl) {
|
|
19
|
+
return autoUpdate(referenceEl, floatingEl, () => {
|
|
20
|
+
updateRect(referenceEl.getBoundingClientRect());
|
|
21
|
+
computePosition(referenceEl, floatingEl, {
|
|
22
|
+
placement: placementByType[type],
|
|
23
|
+
}).then(({ x, y }) => {
|
|
24
|
+
if (type === 'row')
|
|
25
|
+
setFloatingStyles({ left: x, top: y - 1 });
|
|
26
|
+
else
|
|
27
|
+
setFloatingStyles({ left: x - 1, top: y });
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
}, [referenceEl, floatingEl, widhtRef, type, updateRect]);
|
|
33
|
+
return (_jsx(Portal, { children: _jsx("div", { ref: setFloatingEl, style: {
|
|
34
|
+
position: 'absolute',
|
|
35
|
+
zIndex: 1005,
|
|
36
|
+
width,
|
|
37
|
+
height,
|
|
38
|
+
pointerEvents: 'auto',
|
|
39
|
+
outline: 'none',
|
|
40
|
+
backgroundColor: 'var(--g-color-line-brand)',
|
|
41
|
+
...floatingStyles,
|
|
42
|
+
} }) }));
|
|
43
|
+
};
|
|
44
|
+
function useSize(type, getRect) {
|
|
45
|
+
const [size, setSize] = useState(() => getSize(type, getRect()));
|
|
46
|
+
const sizeRef = useLatest(size);
|
|
47
|
+
return {
|
|
48
|
+
width: size.width,
|
|
49
|
+
height: size.height,
|
|
50
|
+
updateRect: useCallback((rect) => {
|
|
51
|
+
const newSize = getSize(type, rect);
|
|
52
|
+
if (type === 'row' && newSize.width !== sizeRef.current.width)
|
|
53
|
+
setSize(newSize);
|
|
54
|
+
if (type === 'column' && newSize.height !== sizeRef.current.height)
|
|
55
|
+
setSize(newSize);
|
|
56
|
+
}, [sizeRef, type]),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function getSize(type, rect) {
|
|
60
|
+
if (type === 'row')
|
|
61
|
+
return { height: 2, width: rect.width };
|
|
62
|
+
return { width: 2, height: rect.height };
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=InsertCursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InsertCursor.js","sourceRoot":"../../../../../../../../../src","sources":["extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/InsertCursor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEvD,6DAA6D;AAC7D,OAAO,EAAwC,UAAU,EAAE,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACpG,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAC,SAAS,EAAC,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAC,eAAe,EAAC,kDAAwB;AAEhD,MAAM,eAAe,GAAiD;IAClE,GAAG,EAAE,cAAc;IACnB,MAAM,EAAE,aAAa;CACxB,CAAC;AAOF,MAAM,CAAC,MAAM,YAAY,GAAgC,SAAS,oBAAoB,CAAC,EACnF,IAAI,EACJ,MAAM,EAAE,WAAW,GACtB;IACG,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,eAAe,EAAE,CAAC;IACtD,MAAM,EAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAC,GAAG,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAC7F,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAClC,MAAM,CAAC,cAAc,EAA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,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAO,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IACvE,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAEhC,OAAO;QACH,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,UAAU,EAAE,WAAW,CACnB,CAAC,IAAU,EAAE,EAAE;YACX,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACpC,IAAI,IAAI,KAAK,KAAK,IAAI,OAAO,CAAC,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,KAAK;gBAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YAChF,IAAI,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,MAAM;gBAC9D,OAAO,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC,EACD,CAAC,OAAO,EAAE,IAAI,CAAC,CAClB;KACJ,CAAC;AACN,CAAC;AAED,SAAS,OAAO,CAAC,IAA+B,EAAE,IAAU;IACxD,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,EAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAC,CAAC;IAC1D,OAAO,EAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC;AAC3C,CAAC","sourcesContent":["import {useCallback, useEffect, useState} from 'react';\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport {type Placement, type ReferenceElement, autoUpdate, computePosition} from '@floating-ui/dom';\nimport {Portal} from '@gravity-ui/uikit';\nimport {useLatest} from 'react-use';\n\nimport {useElementState} from 'src/react-utils';\n\nconst placementByType: Record<InsertCursorProps['type'], Placement> = {\n row: 'bottom-start',\n column: 'right-start',\n};\n\nexport type InsertCursorProps = {\n anchor: ReferenceElement;\n type: 'row' | 'column';\n};\n\nexport const InsertCursor: React.FC<InsertCursorProps> = function YfmTableInsertCursor({\n type,\n anchor: referenceEl,\n}) {\n const [floatingEl, setFloatingEl] = useElementState();\n const {width, height, updateRect} = useSize(type, () => referenceEl.getBoundingClientRect());\n const widhtRef = useLatest(width);\n const [floatingStyles, setFloatingStyles] = useState({top: -9999, left: -9999});\n\n useEffect(() => {\n if (referenceEl && floatingEl) {\n return autoUpdate(referenceEl, floatingEl, () => {\n updateRect(referenceEl.getBoundingClientRect());\n\n computePosition(referenceEl, floatingEl, {\n placement: placementByType[type],\n }).then(({x, y}) => {\n if (type === 'row') setFloatingStyles({left: x, top: y - 1});\n else setFloatingStyles({left: x - 1, top: y});\n });\n });\n }\n return undefined;\n }, [referenceEl, floatingEl, widhtRef, type, updateRect]);\n\n return (\n <Portal>\n <div\n ref={setFloatingEl}\n style={{\n position: 'absolute',\n zIndex: 1005,\n width,\n height,\n pointerEvents: 'auto',\n outline: 'none',\n backgroundColor: 'var(--g-color-line-brand)',\n ...floatingStyles,\n }}\n />\n </Portal>\n );\n};\n\ntype Size = {\n width: number;\n height: number;\n};\n\nfunction useSize(type: InsertCursorProps['type'], getRect: () => Size) {\n const [size, setSize] = useState<Size>(() => getSize(type, getRect()));\n const sizeRef = useLatest(size);\n\n return {\n width: size.width,\n height: size.height,\n updateRect: useCallback(\n (rect: Size) => {\n const newSize = getSize(type, rect);\n if (type === 'row' && newSize.width !== sizeRef.current.width) setSize(newSize);\n if (type === 'column' && newSize.height !== sizeRef.current.height)\n setSize(newSize);\n },\n [sizeRef, type],\n ),\n };\n}\n\nfunction getSize(type: InsertCursorProps['type'], rect: Size): Size {\n if (type === 'row') return {height: 2, width: rect.width};\n return {width: 2, height: rect.height};\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { Plus as PlusIcon } from '@gravity-ui/icons';
|
|
4
|
+
import { Button, Flex, Icon } from '@gravity-ui/uikit';
|
|
5
|
+
import { useBooleanState } from "../../../../../../../react-utils/index.js";
|
|
6
|
+
export const PlusButton = function YfmTablePlusButton({ qa, onClick, onHoverChange, }) {
|
|
7
|
+
const [hovered, setHovered, unsetHovered] = useBooleanState(false);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
onHoverChange(hovered);
|
|
10
|
+
}, [hovered, onHoverChange]);
|
|
11
|
+
return (_jsx(Flex, { centerContent: true, width: 20, height: 20, onMouseEnter: setHovered, onMouseLeave: unsetHovered, style: {
|
|
12
|
+
borderRadius: '100px', // button circle border radius
|
|
13
|
+
backgroundColor: hovered ? 'var(--g-color-base-background)' : undefined,
|
|
14
|
+
}, children: _jsx(Button, { qa: qa, size: "xs", pin: "circle-circle", view: hovered ? 'outlined-action' : 'normal', onClick: onClick, style: {
|
|
15
|
+
'--g-button-height': hovered ? undefined : '4px',
|
|
16
|
+
'--_--background-color-hover': hovered
|
|
17
|
+
? 'var(--g-color-base-background)'
|
|
18
|
+
: undefined,
|
|
19
|
+
color: hovered ? undefined : 'var(--g-color-base-generic)',
|
|
20
|
+
}, children: _jsx(Icon, { data: PlusIcon }) }) }));
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=PlusButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlusButton.js","sourceRoot":"../../../../../../../../../src","sources":["extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/PlusButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAC,IAAI,IAAI,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAC,eAAe,EAAC,kDAAwB;AAOhD,MAAM,CAAC,MAAM,UAAU,GAA8B,SAAS,kBAAkB,CAAC,EAC7E,EAAE,EACF,OAAO,EACP,aAAa,GAChB;IACG,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACnE,SAAS,CAAC,GAAG,EAAE;QACX,aAAa,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;IAE7B,OAAO,CACH,KAAC,IAAI,IACD,aAAa,QACb,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,YAAY,EAAE,UAAU,EACxB,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE;YACH,YAAY,EAAE,OAAO,EAAE,8BAA8B;YACrD,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC,SAAS;SAC1E,YAED,KAAC,MAAM,IACH,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,IAAI,EACT,GAAG,EAAC,eAAe,EACnB,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,QAAQ,EAC5C,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE;gBACH,mBAAmB,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK;gBAChD,6BAA6B,EAAE,OAAO;oBAClC,CAAC,CAAC,gCAAgC;oBAClC,CAAC,CAAC,SAAS;gBACf,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,6BAA6B;aAC7D,YAED,KAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,GAAI,GACnB,GACN,CACV,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {useEffect} from 'react';\n\nimport {Plus as PlusIcon} from '@gravity-ui/icons';\nimport {Button, Flex, Icon, type QAProps} from '@gravity-ui/uikit';\n\nimport {useBooleanState} from 'src/react-utils';\n\nexport type PlusButtonProps = QAProps & {\n onClick: () => void;\n onHoverChange: (hover: boolean) => void;\n};\n\nexport const PlusButton: React.FC<PlusButtonProps> = function YfmTablePlusButton({\n qa,\n onClick,\n onHoverChange,\n}) {\n const [hovered, setHovered, unsetHovered] = useBooleanState(false);\n useEffect(() => {\n onHoverChange(hovered);\n }, [hovered, onHoverChange]);\n\n return (\n <Flex\n centerContent\n width={20} // xs button\n height={20} // xs button\n onMouseEnter={setHovered}\n onMouseLeave={unsetHovered}\n style={{\n borderRadius: '100px', // button circle border radius\n backgroundColor: hovered ? 'var(--g-color-base-background)' : undefined,\n }}\n >\n <Button\n qa={qa}\n size=\"xs\"\n pin=\"circle-circle\"\n view={hovered ? 'outlined-action' : 'normal'}\n onClick={onClick}\n style={{\n '--g-button-height': hovered ? undefined : '4px',\n '--_--background-color-hover': hovered\n ? 'var(--g-color-base-background)'\n : undefined,\n color: hovered ? undefined : 'var(--g-color-base-generic)',\n }}\n >\n <Icon data={PlusIcon} />\n </Button>\n </Flex>\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FloatingPlusButton.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../../../../../../../../../src","sources":["extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusButton/index.ts"],"names":[],"mappings":"AAAA,wCAAqC","sourcesContent":["export * from './FloatingPlusButton';\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type FloatingPlusButtonProps } from "../FloatingPlusButton/index.js";
|
|
2
|
+
export type FloatingPlusControlProps = {
|
|
3
|
+
type: FloatingPlusButtonProps['type'];
|
|
4
|
+
index: number;
|
|
5
|
+
cellElem: Element;
|
|
6
|
+
tableElem: Element;
|
|
7
|
+
onClick: (rowIdx: number) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const FloatingPlusControl: import("react").NamedExoticComponent<FloatingPlusControlProps>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo } from 'react';
|
|
3
|
+
import { FloatingPlusButton } from "../FloatingPlusButton/index.js";
|
|
4
|
+
export const FloatingPlusControl = memo(function YfmTableRowFloatingPlusControl({ type, index, cellElem, tableElem, onClick }) {
|
|
5
|
+
const anchor = useMemo(() => ({
|
|
6
|
+
contextElement: tableElem,
|
|
7
|
+
getBoundingClientRect() {
|
|
8
|
+
const cellRect = cellElem.getBoundingClientRect();
|
|
9
|
+
const tableRect = tableElem.getBoundingClientRect();
|
|
10
|
+
return type === 'row'
|
|
11
|
+
? {
|
|
12
|
+
x: tableRect.x,
|
|
13
|
+
y: cellRect.y,
|
|
14
|
+
width: tableRect.width,
|
|
15
|
+
height: cellRect.height,
|
|
16
|
+
top: cellRect.top,
|
|
17
|
+
left: tableRect.left,
|
|
18
|
+
right: tableRect.right,
|
|
19
|
+
bottom: cellRect.top,
|
|
20
|
+
}
|
|
21
|
+
: {
|
|
22
|
+
x: cellRect.x,
|
|
23
|
+
y: tableRect.y,
|
|
24
|
+
width: cellRect.width,
|
|
25
|
+
height: tableRect.height,
|
|
26
|
+
top: tableRect.top,
|
|
27
|
+
left: cellRect.left,
|
|
28
|
+
right: cellRect.right,
|
|
29
|
+
bottom: tableRect.top,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
}), [cellElem, tableElem, type]);
|
|
33
|
+
return _jsx(FloatingPlusButton, { anchor: anchor, type: type, onClick: () => onClick(index) });
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=FloatingPlusControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingPlusControl.js","sourceRoot":"../../../../../../../../../src","sources":["extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusControl/FloatingPlusControl.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,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,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAI,CAAC;AAC7F,CAAC,CACJ,CAAC","sourcesContent":["import {memo, useMemo} from 'react';\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport type {VirtualElement} from '@floating-ui/dom';\n\nimport {FloatingPlusButton, type FloatingPlusButtonProps} from '../FloatingPlusButton';\n\nexport type FloatingPlusControlProps = {\n type: FloatingPlusButtonProps['type'];\n index: number;\n cellElem: Element;\n tableElem: Element;\n onClick: (rowIdx: number) => void;\n};\n\nexport const FloatingPlusControl = memo<FloatingPlusControlProps>(\n function YfmTableRowFloatingPlusControl({type, index, cellElem, tableElem, onClick}) {\n const anchor = useMemo<VirtualElement>(\n () => ({\n contextElement: tableElem,\n getBoundingClientRect() {\n const cellRect = cellElem.getBoundingClientRect();\n const tableRect = tableElem.getBoundingClientRect();\n\n return type === 'row'\n ? {\n x: tableRect.x,\n y: cellRect.y,\n width: tableRect.width,\n height: cellRect.height,\n top: cellRect.top,\n left: tableRect.left,\n right: tableRect.right,\n bottom: cellRect.top,\n }\n : {\n x: cellRect.x,\n y: tableRect.y,\n width: cellRect.width,\n height: tableRect.height,\n top: tableRect.top,\n left: cellRect.left,\n right: cellRect.right,\n bottom: tableRect.top,\n };\n },\n }),\n [cellElem, tableElem, type],\n );\n\n return <FloatingPlusButton anchor={anchor} type={type} onClick={() => onClick(index)} />;\n },\n);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FloatingPlusControl.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../../../../../../../../../src","sources":["extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPlusControl/index.ts"],"names":[],"mappings":"AAAA,yCAAsC","sourcesContent":["export * from './FloatingPlusControl';\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.g-md-yfm-table-floating-popup {
|
|
2
|
+
position: relative;
|
|
3
|
+
border-radius: var(--g-border-radius-xs);
|
|
4
|
+
outline: none;
|
|
5
|
+
background-color: var(--g-color-base-float);
|
|
6
|
+
}
|
|
7
|
+
.g-md-yfm-table-floating-popup > :first-child {
|
|
8
|
+
border-start-start-radius: inherit;
|
|
9
|
+
border-start-end-radius: inherit;
|
|
10
|
+
}
|
|
11
|
+
.g-md-yfm-table-floating-popup > :last-child {
|
|
12
|
+
border-end-end-radius: inherit;
|
|
13
|
+
border-end-start-radius: inherit;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type OffsetOptions, type Placement, type ReferenceType } from '@floating-ui/react';
|
|
2
|
+
import { type DOMProps, type QAProps } from '@gravity-ui/uikit';
|
|
3
|
+
import "./FloatingPopup.css";
|
|
4
|
+
export type FloatingPopupProps = QAProps & DOMProps & {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
zIndex?: number;
|
|
7
|
+
placement: Placement;
|
|
8
|
+
offset?: OffsetOptions;
|
|
9
|
+
anchorElement: ReferenceType | undefined | null;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
floatingStyles?: React.CSSProperties;
|
|
12
|
+
};
|
|
13
|
+
export declare const FloatingPopup: React.FC<FloatingPopupProps>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
///
|
|
3
|
+
/// Fork of Popup component from @gravity-ui/uikit
|
|
4
|
+
/// This fork does not use floating focus manager
|
|
5
|
+
///
|
|
6
|
+
import { useEffect, useMemo } from 'react';
|
|
7
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
8
|
+
import { FloatingNode, FloatingTree, autoUpdate, offset as offsetMiddleware, useFloating, useFloatingNodeId, useFloatingParentNodeId, useInteractions, } from '@floating-ui/react';
|
|
9
|
+
import { Portal } from '@gravity-ui/uikit';
|
|
10
|
+
import { cn } from "../../../../../../../classname.js";
|
|
11
|
+
import "./FloatingPopup.css";
|
|
12
|
+
const b = cn('yfm-table-floating-popup');
|
|
13
|
+
export const FloatingPopup = function YfmTableFloatingPopup(props) {
|
|
14
|
+
const { anchorElement, zIndex = 1000, style, className, qa, children, floatingStyles: floatingStylesFromProps, } = props;
|
|
15
|
+
const nodeId = useFloatingNodeId();
|
|
16
|
+
const parentId = useFloatingParentNodeId();
|
|
17
|
+
const middleware = useMemo(() => [offsetMiddleware(props.offset)], [props.offset]);
|
|
18
|
+
const { refs, elements, floatingStyles, placement, context: { open }, update, } = useFloating({
|
|
19
|
+
nodeId,
|
|
20
|
+
open: props.open,
|
|
21
|
+
placement: props.placement,
|
|
22
|
+
middleware,
|
|
23
|
+
});
|
|
24
|
+
const { getFloatingProps } = useInteractions();
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (anchorElement !== undefined && anchorElement !== refs.reference.current) {
|
|
27
|
+
refs.setReference(anchorElement);
|
|
28
|
+
}
|
|
29
|
+
}, [anchorElement, refs]);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (elements.reference && elements.floating) {
|
|
32
|
+
return autoUpdate(elements.reference, elements.floating, update);
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
}, [elements, update]);
|
|
36
|
+
function wrapper(node) {
|
|
37
|
+
if (parentId === null) {
|
|
38
|
+
return _jsx(FloatingTree, { children: node });
|
|
39
|
+
}
|
|
40
|
+
return node;
|
|
41
|
+
}
|
|
42
|
+
return wrapper(_jsx(FloatingNode, { id: nodeId, children: open ? (_jsx(Portal, { children: _jsx("div", { ref: refs.setFloating, style: {
|
|
43
|
+
position: 'absolute',
|
|
44
|
+
top: 0,
|
|
45
|
+
left: 0,
|
|
46
|
+
zIndex,
|
|
47
|
+
width: 'max-content',
|
|
48
|
+
pointerEvents: 'auto',
|
|
49
|
+
outline: 'none',
|
|
50
|
+
...floatingStylesFromProps,
|
|
51
|
+
...floatingStyles,
|
|
52
|
+
}, "data-floating-ui-placement": placement, ...getFloatingProps(), children: _jsx("div", { className: b(null, className), style: style, "data-qa": qa, children: children }) }) })) : null }));
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=FloatingPopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingPopup.js","sourceRoot":"../../../../../../../../../src","sources":["extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/FloatingPopup.tsx"],"names":[],"mappings":";AAAA,GAAG;AACH,kDAAkD;AAClD,iDAAiD;AACjD,GAAG;AAEH,OAAO,EAAC,SAAS,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAEzC,6DAA6D;AAC7D,OAAO,EACH,YAAY,EACZ,YAAY,EAIZ,UAAU,EACV,MAAM,IAAI,gBAAgB,EAC1B,WAAW,EACX,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAgB,MAAM,EAAe,MAAM,mBAAmB,CAAC;AAEtE,OAAO,EAAC,EAAE,EAAC,0CAAsB;AAEjC,6BAA8B;AAE9B,MAAM,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC,CAAC;AAazC,MAAM,CAAC,MAAM,aAAa,GAAiC,SAAS,qBAAqB,CACrF,KAAyB;IAEzB,MAAM,EACF,aAAa,EACb,MAAM,GAAG,IAAI,EACb,KAAK,EACL,SAAS,EACT,EAAE,EACF,QAAQ,EACR,cAAc,EAAE,uBAAuB,GAC1C,GAAG,KAAK,CAAC;IAEV,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAG,uBAAuB,EAAE,CAAC;IAE3C,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAEnF,MAAM,EACF,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,SA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Aa,EAAE,MAAM;oBACrB,OAAO,EAAE,MAAM;oBACf,GAAG,uBAAuB;oBAC1B,GAAG,cAAc;iBACpB,gCAC2B,SAAS,KACjC,gBAAgB,EAAE,YAEtB,cAAK,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,aAAW,EAAE,YACxD,QAAQ,GACP,GACJ,GACD,CACZ,CAAC,CAAC,CAAC,IAAI,GACG,CAClB,CAAC;AACN,CAAC,CAAC","sourcesContent":["///\n/// Fork of Popup component from @gravity-ui/uikit\n/// This fork does not use floating focus manager\n///\n\nimport {useEffect, useMemo} from 'react';\n\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport {\n FloatingNode,\n FloatingTree,\n type OffsetOptions,\n type Placement,\n type ReferenceType,\n autoUpdate,\n offset as offsetMiddleware,\n useFloating,\n useFloatingNodeId,\n useFloatingParentNodeId,\n useInteractions,\n} from '@floating-ui/react';\nimport {type DOMProps, Portal, type QAProps} from '@gravity-ui/uikit';\n\nimport {cn} from 'src/classname';\n\nimport './FloatingPopup.scss';\n\nconst b = cn('yfm-table-floating-popup');\n\nexport type FloatingPopupProps = QAProps &\n DOMProps & {\n open?: boolean;\n zIndex?: number;\n placement: Placement;\n offset?: OffsetOptions;\n anchorElement: ReferenceType | undefined | null;\n children: React.ReactNode;\n floatingStyles?: React.CSSProperties;\n };\n\nexport const FloatingPopup: React.FC<FloatingPopupProps> = function YfmTableFloatingPopup(\n props: FloatingPopupProps,\n) {\n const {\n anchorElement,\n zIndex = 1000,\n style,\n className,\n qa,\n children,\n floatingStyles: floatingStylesFromProps,\n } = props;\n\n const nodeId = useFloatingNodeId();\n const parentId = useFloatingParentNodeId();\n\n const middleware = useMemo(() => [offsetMiddleware(props.offset)], [props.offset]);\n\n const {\n refs,\n elements,\n floatingStyles,\n placement,\n context: {open},\n update,\n } = useFloating({\n nodeId,\n open: props.open,\n placement: props.placement,\n middleware,\n });\n\n const {getFloatingProps} = useInteractions();\n\n useEffect(() => {\n if (anchorElement !== undefined && anchorElement !== refs.reference.current) {\n refs.setReference(anchorElement);\n }\n }, [anchorElement, refs]);\n\n useEffect(() => {\n if (elements.reference && elements.floating) {\n return autoUpdate(elements.reference, elements.floating, update);\n }\n return undefined;\n }, [elements, update]);\n\n function wrapper(node: JSX.Element) {\n if (parentId === null) {\n return <FloatingTree>{node}</FloatingTree>;\n }\n\n return node;\n }\n\n return wrapper(\n <FloatingNode id={nodeId}>\n {open ? (\n <Portal>\n <div\n ref={refs.setFloating}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n zIndex,\n width: 'max-content',\n pointerEvents: 'auto',\n outline: 'none',\n ...floatingStylesFromProps,\n ...floatingStyles,\n }}\n data-floating-ui-placement={placement}\n {...getFloatingProps()}\n >\n <div className={b(null, className)} style={style} data-qa={qa}>\n {children}\n </div>\n </div>\n </Portal>\n ) : null}\n </FloatingNode>,\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FloatingPopup.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../../../../../../../../../src","sources":["extensions/yfm/YfmTable/plugins/YfmTableControls/components/FloatingPopup/index.ts"],"names":[],"mappings":"AAAA,mCAAgC","sourcesContent":["export * from './FloatingPopup';\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const YfmTableDecorationTypeKey = "__yfm-table-deco-type";
|
|
2
|
+
export declare const YfmTableDecorationUniqKey = "__yfm-table-deco-uniq-key";
|
|
3
|
+
export declare enum YfmTableDecorationType {
|
|
4
|
+
FocusTable = "table--focus",
|
|
5
|
+
ShowRowControl = "cell--show-row-control",// to show the row control in the cell
|
|
6
|
+
ShowColumnControl = "cell--show-column-control",// to show the column control in the cell
|
|
7
|
+
OpenRowMenu = "cell--open-row-menu",// sign of opening the row menu in the cell
|
|
8
|
+
OpenColumnMenu = "cell--open-column-menu",// sign of opening the column menu in the cell
|
|
9
|
+
ActivateRow = "row--active",
|
|
10
|
+
ActivateColumnCells = "cell--active-column",
|
|
11
|
+
ActivateDangerRow = "row--danger",
|
|
12
|
+
ActivateDangerColumnCells = "cell--danger-column"
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const YfmTableDecorationTypeKey = '__yfm-table-deco-type';
|
|
2
|
+
export const YfmTableDecorationUniqKey = '__yfm-table-deco-uniq-key';
|
|
3
|
+
export var YfmTableDecorationType;
|
|
4
|
+
(function (YfmTableDecorationType) {
|
|
5
|
+
YfmTableDecorationType["FocusTable"] = "table--focus";
|
|
6
|
+
YfmTableDecorationType["ShowRowControl"] = "cell--show-row-control";
|
|
7
|
+
YfmTableDecorationType["ShowColumnControl"] = "cell--show-column-control";
|
|
8
|
+
YfmTableDecorationType["OpenRowMenu"] = "cell--open-row-menu";
|
|
9
|
+
YfmTableDecorationType["OpenColumnMenu"] = "cell--open-column-menu";
|
|
10
|
+
YfmTableDecorationType["ActivateRow"] = "row--active";
|
|
11
|
+
YfmTableDecorationType["ActivateColumnCells"] = "cell--active-column";
|
|
12
|
+
YfmTableDecorationType["ActivateDangerRow"] = "row--danger";
|
|
13
|
+
YfmTableDecorationType["ActivateDangerColumnCells"] = "cell--danger-column";
|
|
14
|
+
})(YfmTableDecorationType || (YfmTableDecorationType = {}));
|
|
15
|
+
//# sourceMappingURL=const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"../../../../../../../src","sources":["extensions/yfm/YfmTable/plugins/YfmTableControls/const.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AACjE,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AAErE,MAAM,CAAN,IAAY,sBAcX;AAdD,WAAY,sBAAsB;IAC9B,qDAA2B,CAAA;IAE3B,mEAAyC,CAAA;IACzC,yEAA+C,CAAA;IAE/C,6DAAmC,CAAA;IACnC,mEAAyC,CAAA;IAEzC,qDAA2B,CAAA;IAC3B,qEAA2C,CAAA;IAE3C,2DAAiC,CAAA;IACjC,2EAAiD,CAAA;AACrD,CAAC,EAdW,sBAAsB,KAAtB,sBAAsB,QAcjC","sourcesContent":["export const YfmTableDecorationTypeKey = '__yfm-table-deco-type';\nexport const YfmTableDecorationUniqKey = '__yfm-table-deco-uniq-key';\n\nexport enum YfmTableDecorationType {\n FocusTable = 'table--focus',\n\n ShowRowControl = 'cell--show-row-control', // to show the row control in the cell\n ShowColumnControl = 'cell--show-column-control', // to show the column control in the cell\n\n OpenRowMenu = 'cell--open-row-menu', // sign of opening the row menu in the cell\n OpenColumnMenu = 'cell--open-column-menu', // sign of opening the column menu in the cell\n\n ActivateRow = 'row--active',\n ActivateColumnCells = 'cell--active-column',\n\n ActivateDangerRow = 'row--danger',\n ActivateDangerColumnCells = 'cell--danger-column',\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { EditorView } from "../../../../../../pm/view.js";
|
|
2
|
+
/** Same as `DropCursorOptions` from _prosemirror-dropcursor_ package */
|
|
3
|
+
export type DropCursorParams = {
|
|
4
|
+
/** The color of the cursor. Defaults to `black`. Use `false` to apply no color and rely only on class. */
|
|
5
|
+
color?: string | false;
|
|
6
|
+
/** The precise width of the cursor in pixels. Defaults to 1. */
|
|
7
|
+
width?: number;
|
|
8
|
+
/** A CSS class name to add to the cursor element. */
|
|
9
|
+
class?: string;
|
|
10
|
+
};
|
|
11
|
+
type Rect = {
|
|
12
|
+
left: number;
|
|
13
|
+
right: number;
|
|
14
|
+
top: number;
|
|
15
|
+
bottom: number;
|
|
16
|
+
};
|
|
17
|
+
export declare class DropCursor {
|
|
18
|
+
protected readonly editorView: EditorView;
|
|
19
|
+
protected readonly width: number;
|
|
20
|
+
protected readonly color: string | undefined;
|
|
21
|
+
protected readonly class: string | undefined;
|
|
22
|
+
protected cursorElem: HTMLElement | null;
|
|
23
|
+
private cursorPos;
|
|
24
|
+
constructor(editorView: EditorView, params?: DropCursorParams);
|
|
25
|
+
getPos(): number | null;
|
|
26
|
+
setPos(val: number): void;
|
|
27
|
+
clear(): void;
|
|
28
|
+
update(): void;
|
|
29
|
+
protected render(rect: Rect, { isBlock }: {
|
|
30
|
+
isBlock: boolean;
|
|
31
|
+
}): void;
|
|
32
|
+
}
|
|
33
|
+
export declare class TableColumnDropCursor extends DropCursor {
|
|
34
|
+
update(): void;
|
|
35
|
+
}
|
|
36
|
+
export {};
|