@threadlabs/looma 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/components/shared/input-modality.d.ts +8 -0
- package/components/shared/input-modality.js +2 -0
- package/components/ui-button/ui-button.html +42 -1
- package/components/ui-combobox/ui-combobox.html +12 -4
- package/components/ui-dialog/ui-dialog.html +13 -0
- package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.html +1 -1
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +1 -1
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +6 -2
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +20 -4
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +8 -4
- package/components/ui-form-field/ui-form-field.html +18 -7
- package/components/ui-icon/ui-icon.html +5 -1
- package/components/ui-icon-button/ui-icon-button.html +44 -1
- package/components/ui-popover/ui-popover.js +10 -2
- package/components/ui-search-shell/ui-search-shell.html +7 -0
- package/components/ui-search-shell/ui-search-shell.js +9 -0
- package/components/ui-tabs/ui-tabs.html +1 -1
- package/components/ui-toast-region/ui-toast-region.html +1 -1
- package/components/ui-tree-item/ui-tree-item.html +6 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +2 -2
- package/styles/ui-affordance-scope.css +1 -1
- package/styles/ui-avatar-group.css +1 -1
- package/styles/ui-avatar.css +1 -1
- package/styles/ui-badge.css +1 -1
- package/styles/ui-button.css +42 -2
- package/styles/ui-callout.css +1 -1
- package/styles/ui-checkbox.css +1 -1
- package/styles/ui-cluster.css +1 -1
- package/styles/ui-combobox.css +1 -1
- package/styles/ui-container.css +1 -1
- package/styles/ui-context-menu.css +1 -1
- package/styles/ui-dialog.css +18 -1
- package/styles/ui-disclosure.css +1 -1
- package/styles/ui-editable.css +1 -1
- package/styles/ui-editor-insert-table-grid.css +1 -1
- package/styles/ui-editor-mention-menu.css +1 -1
- package/styles/ui-editor-slash-menu.css +1 -1
- package/styles/ui-editor-table-context-menu.css +1 -1
- package/styles/ui-editor-table-overlay.css +1 -1
- package/styles/ui-editor-table-toolbar.css +1 -1
- package/styles/ui-editor-toolbar.css +1 -1
- package/styles/ui-floating-action-button.css +1 -1
- package/styles/ui-form-field.css +24 -10
- package/styles/ui-grid.css +1 -1
- package/styles/ui-icon-button.css +52 -2
- package/styles/ui-icon.css +1 -1
- package/styles/ui-input.css +1 -1
- package/styles/ui-menu-item.css +1 -1
- package/styles/ui-menu.css +1 -1
- package/styles/ui-popover.css +1 -1
- package/styles/ui-radio-group.css +1 -1
- package/styles/ui-radio.css +1 -1
- package/styles/ui-reel.css +1 -1
- package/styles/ui-search-result-row.css +1 -1
- package/styles/ui-search-shell.css +11 -2
- package/styles/ui-select.css +1 -1
- package/styles/ui-separator.css +1 -1
- package/styles/ui-sidebar.css +1 -1
- package/styles/ui-stack.css +1 -1
- package/styles/ui-switch.css +1 -1
- package/styles/ui-switcher.css +1 -1
- package/styles/ui-tabs.css +1 -1
- package/styles/ui-textarea.css +1 -1
- package/styles/ui-toast-region.css +1 -1
- package/styles/ui-tooltip.css +1 -1
- package/styles/ui-top-bar.css +1 -1
- package/styles/ui-tree-item.css +10 -2
- package/styles/ui-tree.css +1 -1
- package/vanilla/UiAffordanceScope.d.ts +1 -1
- package/vanilla/UiAffordanceScope.js +2 -2
- package/vanilla/UiAvatar.d.ts +1 -1
- package/vanilla/UiAvatar.js +2 -2
- package/vanilla/UiAvatarGroup.d.ts +1 -1
- package/vanilla/UiAvatarGroup.js +2 -2
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +2 -2
- package/vanilla/UiButton.d.ts +3 -1
- package/vanilla/UiButton.js +3 -3
- package/vanilla/UiCallout.d.ts +1 -1
- package/vanilla/UiCallout.js +2 -2
- package/vanilla/UiCheckbox.d.ts +1 -1
- package/vanilla/UiCheckbox.js +2 -2
- package/vanilla/UiCluster.d.ts +1 -1
- package/vanilla/UiCluster.js +2 -2
- package/vanilla/UiCombobox.d.ts +1 -1
- package/vanilla/UiCombobox.js +3 -3
- package/vanilla/UiContainer.d.ts +1 -1
- package/vanilla/UiContainer.js +2 -2
- package/vanilla/UiContextMenu.d.ts +1 -1
- package/vanilla/UiContextMenu.js +2 -2
- package/vanilla/UiDialog.d.ts +1 -1
- package/vanilla/UiDialog.js +2 -2
- package/vanilla/UiDisclosure.d.ts +1 -1
- package/vanilla/UiDisclosure.js +2 -2
- package/vanilla/UiEditable.d.ts +1 -1
- package/vanilla/UiEditable.js +2 -2
- package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
- package/vanilla/UiEditorInsertTableGrid.js +3 -3
- package/vanilla/UiEditorMentionMenu.d.ts +1 -1
- package/vanilla/UiEditorMentionMenu.js +3 -3
- package/vanilla/UiEditorSlashMenu.d.ts +1 -1
- package/vanilla/UiEditorSlashMenu.js +2 -2
- package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
- package/vanilla/UiEditorTableContextMenu.js +3 -3
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +3 -3
- package/vanilla/UiEditorTableToolbar.d.ts +1 -1
- package/vanilla/UiEditorTableToolbar.js +3 -3
- package/vanilla/UiEditorToolbar.d.ts +1 -1
- package/vanilla/UiEditorToolbar.js +2 -2
- package/vanilla/UiFloatingActionButton.d.ts +1 -1
- package/vanilla/UiFloatingActionButton.js +2 -2
- package/vanilla/UiFormField.d.ts +1 -1
- package/vanilla/UiFormField.js +15 -6
- package/vanilla/UiGrid.d.ts +1 -1
- package/vanilla/UiGrid.js +2 -2
- package/vanilla/UiIcon.d.ts +1 -1
- package/vanilla/UiIcon.js +3 -3
- package/vanilla/UiIconButton.d.ts +1 -1
- package/vanilla/UiIconButton.js +2 -2
- package/vanilla/UiInput.d.ts +1 -1
- package/vanilla/UiInput.js +2 -2
- package/vanilla/UiMenu.d.ts +1 -1
- package/vanilla/UiMenu.js +2 -2
- package/vanilla/UiMenuItem.d.ts +1 -1
- package/vanilla/UiMenuItem.js +2 -2
- package/vanilla/UiPopover.d.ts +1 -1
- package/vanilla/UiPopover.js +2 -2
- package/vanilla/UiRadio.d.ts +1 -1
- package/vanilla/UiRadio.js +2 -2
- package/vanilla/UiRadioGroup.d.ts +1 -1
- package/vanilla/UiRadioGroup.js +2 -2
- package/vanilla/UiReel.d.ts +1 -1
- package/vanilla/UiReel.js +2 -2
- package/vanilla/UiSearchResultRow.d.ts +1 -1
- package/vanilla/UiSearchResultRow.js +2 -2
- package/vanilla/UiSearchShell.d.ts +1 -1
- package/vanilla/UiSearchShell.js +2 -2
- package/vanilla/UiSelect.d.ts +1 -1
- package/vanilla/UiSelect.js +2 -2
- package/vanilla/UiSeparator.d.ts +1 -1
- package/vanilla/UiSeparator.js +2 -2
- package/vanilla/UiSidebar.d.ts +1 -1
- package/vanilla/UiSidebar.js +2 -2
- package/vanilla/UiStack.d.ts +1 -1
- package/vanilla/UiStack.js +2 -2
- package/vanilla/UiSwitch.d.ts +1 -1
- package/vanilla/UiSwitch.js +2 -2
- package/vanilla/UiSwitcher.d.ts +1 -1
- package/vanilla/UiSwitcher.js +2 -2
- package/vanilla/UiTabs.d.ts +1 -1
- package/vanilla/UiTabs.js +3 -3
- package/vanilla/UiTextarea.d.ts +1 -1
- package/vanilla/UiTextarea.js +2 -2
- package/vanilla/UiToastRegion.d.ts +1 -1
- package/vanilla/UiToastRegion.js +3 -3
- package/vanilla/UiTooltip.d.ts +1 -1
- package/vanilla/UiTooltip.js +2 -2
- package/vanilla/UiTopBar.d.ts +1 -1
- package/vanilla/UiTopBar.js +1 -1
- package/vanilla/UiTree.d.ts +1 -1
- package/vanilla/UiTree.js +2 -2
- package/vanilla/UiTreeItem.d.ts +1 -1
- package/vanilla/UiTreeItem.js +2 -2
- package/vue/UiAffordanceScope.d.ts +2 -2
- package/vue/UiAffordanceScope.vue +92 -73
- package/vue/UiAvatar.d.ts +7 -7
- package/vue/UiAvatar.vue +145 -105
- package/vue/UiAvatarGroup.d.ts +4 -4
- package/vue/UiAvatarGroup.vue +134 -118
- package/vue/UiBadge.d.ts +4 -4
- package/vue/UiBadge.vue +113 -114
- package/vue/UiButton.d.ts +10 -6
- package/vue/UiButton.vue +289 -220
- package/vue/UiCallout.d.ts +2 -2
- package/vue/UiCallout.vue +154 -87
- package/vue/UiCheckbox.d.ts +14 -10
- package/vue/UiCheckbox.vue +228 -162
- package/vue/UiCluster.d.ts +2 -2
- package/vue/UiCluster.vue +53 -60
- package/vue/UiCombobox.d.ts +36 -32
- package/vue/UiCombobox.vue +1005 -416
- package/vue/UiContainer.d.ts +2 -2
- package/vue/UiContainer.vue +48 -51
- package/vue/UiContextMenu.d.ts +6 -4
- package/vue/UiContextMenu.vue +205 -116
- package/vue/UiDialog.d.ts +11 -9
- package/vue/UiDialog.vue +287 -212
- package/vue/UiDisclosure.d.ts +8 -6
- package/vue/UiDisclosure.vue +248 -159
- package/vue/UiEditable.d.ts +16 -12
- package/vue/UiEditable.vue +325 -205
- package/vue/UiEditorInsertTableGrid.d.ts +8 -8
- package/vue/UiEditorInsertTableGrid.vue +216 -157
- package/vue/UiEditorMentionMenu.d.ts +9 -9
- package/vue/UiEditorMentionMenu.vue +265 -222
- package/vue/UiEditorSlashMenu.d.ts +7 -7
- package/vue/UiEditorSlashMenu.vue +286 -240
- package/vue/UiEditorTableContextMenu.d.ts +5 -5
- package/vue/UiEditorTableContextMenu.vue +306 -193
- package/vue/UiEditorTableOverlay.d.ts +2 -2
- package/vue/UiEditorTableOverlay.vue +609 -369
- package/vue/UiEditorTableToolbar.d.ts +7 -7
- package/vue/UiEditorTableToolbar.vue +443 -268
- package/vue/UiEditorToolbar.d.ts +2 -2
- package/vue/UiEditorToolbar.vue +134 -121
- package/vue/UiFloatingActionButton.d.ts +6 -6
- package/vue/UiFloatingActionButton.vue +100 -99
- package/vue/UiFormField.d.ts +6 -6
- package/vue/UiFormField.vue +112 -80
- package/vue/UiGrid.d.ts +2 -2
- package/vue/UiGrid.vue +51 -57
- package/vue/UiIcon.d.ts +2 -2
- package/vue/UiIcon.vue +118 -89
- package/vue/UiIconButton.d.ts +11 -11
- package/vue/UiIconButton.vue +285 -206
- package/vue/UiInput.d.ts +9 -9
- package/vue/UiInput.vue +153 -127
- package/vue/UiMenu.d.ts +8 -6
- package/vue/UiMenu.vue +217 -143
- package/vue/UiMenuItem.d.ts +4 -4
- package/vue/UiMenuItem.vue +52 -46
- package/vue/UiPopover.d.ts +8 -6
- package/vue/UiPopover.vue +197 -137
- package/vue/UiRadio.d.ts +14 -10
- package/vue/UiRadio.vue +183 -117
- package/vue/UiRadioGroup.d.ts +14 -12
- package/vue/UiRadioGroup.vue +172 -111
- package/vue/UiReel.d.ts +3 -3
- package/vue/UiReel.vue +77 -77
- package/vue/UiSearchResultRow.d.ts +4 -4
- package/vue/UiSearchResultRow.vue +124 -115
- package/vue/UiSearchShell.d.ts +10 -8
- package/vue/UiSearchShell.vue +245 -176
- package/vue/UiSelect.d.ts +9 -9
- package/vue/UiSelect.vue +162 -134
- package/vue/UiSeparator.d.ts +2 -2
- package/vue/UiSeparator.vue +22 -27
- package/vue/UiSidebar.d.ts +20 -18
- package/vue/UiSidebar.vue +312 -224
- package/vue/UiStack.d.ts +3 -3
- package/vue/UiStack.vue +64 -70
- package/vue/UiSwitch.d.ts +12 -8
- package/vue/UiSwitch.vue +218 -150
- package/vue/UiSwitcher.d.ts +3 -3
- package/vue/UiSwitcher.vue +73 -75
- package/vue/UiTabs.d.ts +10 -8
- package/vue/UiTabs.vue +251 -210
- package/vue/UiTextarea.d.ts +11 -11
- package/vue/UiTextarea.vue +155 -128
- package/vue/UiToastRegion.d.ts +10 -8
- package/vue/UiToastRegion.vue +261 -198
- package/vue/UiTooltip.d.ts +14 -12
- package/vue/UiTooltip.vue +241 -177
- package/vue/UiTopBar.vue +51 -42
- package/vue/UiTree.d.ts +8 -6
- package/vue/UiTree.vue +157 -70
- package/vue/UiTreeItem.d.ts +24 -22
- package/vue/UiTreeItem.vue +456 -339
- package/vue/chunks/UiAffordanceScope.js +9 -16
- package/vue/chunks/UiAvatar.js +23 -29
- package/vue/chunks/UiAvatarGroup.js +16 -39
- package/vue/chunks/UiBadge.js +3 -12
- package/vue/chunks/UiButton.js +15 -18
- package/vue/chunks/UiCallout.js +8 -17
- package/vue/chunks/UiCheckbox.js +37 -40
- package/vue/chunks/UiCluster.js +3 -12
- package/vue/chunks/UiCombobox.js +224 -266
- package/vue/chunks/UiContainer.js +3 -12
- package/vue/chunks/UiContextMenu.js +39 -34
- package/vue/chunks/UiDialog.js +36 -39
- package/vue/chunks/UiDisclosure.js +43 -48
- package/vue/chunks/UiEditable.js +55 -57
- package/vue/chunks/UiEditorInsertTableGrid.js +55 -73
- package/vue/chunks/UiEditorMentionMenu.js +40 -81
- package/vue/chunks/UiEditorSlashMenu.js +28 -52
- package/vue/chunks/UiEditorTableContextMenu.js +32 -56
- package/vue/chunks/UiEditorTableOverlay.js +58 -82
- package/vue/chunks/UiEditorTableToolbar.js +61 -85
- package/vue/chunks/UiEditorToolbar.js +4 -13
- package/vue/chunks/UiFloatingActionButton.js +7 -21
- package/vue/chunks/UiFormField.js +15 -12
- package/vue/chunks/UiGrid.js +3 -12
- package/vue/chunks/UiIcon.js +20 -43
- package/vue/chunks/UiIconButton.js +16 -28
- package/vue/chunks/UiInput.js +20 -25
- package/vue/chunks/UiMenu.js +29 -33
- package/vue/chunks/UiMenuItem.js +4 -10
- package/vue/chunks/UiPopover.js +28 -29
- package/vue/chunks/UiRadio.js +36 -39
- package/vue/chunks/UiRadioGroup.js +30 -34
- package/vue/chunks/UiReel.js +6 -15
- package/vue/chunks/UiSearchResultRow.js +6 -19
- package/vue/chunks/UiSearchShell.js +25 -28
- package/vue/chunks/UiSelect.js +20 -23
- package/vue/chunks/UiSeparator.js +2 -8
- package/vue/chunks/UiSidebar.js +39 -44
- package/vue/chunks/UiStack.js +6 -15
- package/vue/chunks/UiSwitch.js +35 -38
- package/vue/chunks/UiSwitcher.js +6 -15
- package/vue/chunks/UiTabs.js +47 -85
- package/vue/chunks/UiTextarea.js +21 -26
- package/vue/chunks/UiToastRegion.js +38 -72
- package/vue/chunks/UiTooltip.js +34 -35
- package/vue/chunks/UiTopBar.js +1 -1
- package/vue/chunks/UiTree.js +20 -15
- package/vue/chunks/UiTreeItem.js +85 -102
- package/vue/components.css +3994 -3764
- package/vue/index.d.ts +1 -0
- package/vue/index.js +2 -1
|
@@ -1,455 +1,695 @@
|
|
|
1
|
-
<!-- Generated by HTML Next 1.0.0-alpha.
|
|
1
|
+
<!-- Generated by HTML Next 1.0.0-alpha.2 for Vue 3.5. Do not edit. -->
|
|
2
2
|
<script setup lang="ts">
|
|
3
|
-
import { computed, onBeforeUnmount, onMounted, ref, shallowRef, watchEffect } from
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
defineOptions({ inheritAttrs: false })
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
3
|
+
import { computed, onBeforeUnmount, onMounted, ref, shallowRef, watchEffect } from 'vue'
|
|
4
|
+
import * as controllerModule from '../components/ui-editor-table-overlay/ui-editor-table-overlay.js'
|
|
5
|
+
import UiIcon from './UiIcon.vue'
|
|
6
|
+
|
|
7
|
+
defineOptions({ inheritAttrs: false })
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(
|
|
10
|
+
defineProps<{
|
|
11
|
+
geometry?: {
|
|
12
|
+
readonly rowBoundaries: readonly (number)[]
|
|
13
|
+
readonly columnBoundaries: readonly (number)[]
|
|
14
|
+
readonly activeCell: {
|
|
15
|
+
readonly left: number
|
|
16
|
+
readonly top: number
|
|
17
|
+
readonly width: number
|
|
18
|
+
readonly height: number
|
|
19
|
+
readonly rowIndex: number
|
|
20
|
+
readonly columnIndex: number
|
|
21
|
+
} | null
|
|
22
|
+
readonly hoveredCell?: {
|
|
23
|
+
readonly left: number
|
|
24
|
+
readonly top: number
|
|
25
|
+
readonly width: number
|
|
26
|
+
readonly height: number
|
|
27
|
+
readonly rowIndex: number
|
|
28
|
+
readonly columnIndex: number
|
|
29
|
+
} | null
|
|
30
|
+
} | null
|
|
31
|
+
open?: boolean
|
|
32
|
+
}>(),
|
|
33
|
+
{
|
|
34
|
+
open: false,
|
|
32
35
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const props = withDefaults(defineProps<{
|
|
36
|
-
geometry?: { readonly rowBoundaries: readonly (number)[]; readonly columnBoundaries: readonly (number)[]; readonly activeCell: { readonly left: number; readonly top: number; readonly width: number; readonly height: number; readonly rowIndex: number; readonly columnIndex: number } | null; readonly hoveredCell?: { readonly left: number; readonly top: number; readonly width: number; readonly height: number; readonly rowIndex: number; readonly columnIndex: number } | null } | null;
|
|
37
|
-
open?: boolean | null;
|
|
38
|
-
}>(), {
|
|
39
|
-
open: false,
|
|
40
|
-
});
|
|
36
|
+
)
|
|
41
37
|
const emit = defineEmits<{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
action: [
|
|
39
|
+
detail: {
|
|
40
|
+
readonly action: 'add-row-before' | 'add-row-after' | 'add-column-before' | 'add-column-after'
|
|
41
|
+
readonly boundaryIndex: number
|
|
42
|
+
} | {
|
|
43
|
+
readonly action: 'select-row' | 'select-column'
|
|
44
|
+
readonly rowIndex: number
|
|
45
|
+
readonly columnIndex: number
|
|
46
|
+
} | {
|
|
47
|
+
readonly action: 'open-cell-menu'
|
|
48
|
+
readonly rowIndex: number
|
|
49
|
+
readonly columnIndex: number
|
|
50
|
+
readonly anchor: {
|
|
51
|
+
readonly left: number
|
|
52
|
+
readonly top: number
|
|
53
|
+
readonly right: number
|
|
54
|
+
readonly bottom: number
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
]
|
|
58
|
+
}>()
|
|
59
|
+
|
|
60
|
+
const root = ref<HTMLElement | null>(null)
|
|
61
|
+
const rows = ref<
|
|
62
|
+
{
|
|
63
|
+
key: string
|
|
64
|
+
index: number
|
|
65
|
+
offset: string
|
|
66
|
+
affordance: 'insert-row' | 'insert-column'
|
|
67
|
+
action: 'add-row-before' | 'add-row-after' | 'add-column-before' | 'add-column-after'
|
|
68
|
+
label: string
|
|
69
|
+
}[]
|
|
70
|
+
>([])
|
|
71
|
+
const cols = ref<
|
|
72
|
+
{
|
|
73
|
+
key: string
|
|
74
|
+
index: number
|
|
75
|
+
offset: string
|
|
76
|
+
affordance: 'insert-row' | 'insert-column'
|
|
77
|
+
action: 'add-row-before' | 'add-row-after' | 'add-column-before' | 'add-column-after'
|
|
78
|
+
label: string
|
|
79
|
+
}[]
|
|
80
|
+
>([])
|
|
81
|
+
const hovered = ref<
|
|
82
|
+
{
|
|
83
|
+
left: number
|
|
84
|
+
top: number
|
|
85
|
+
width: number
|
|
86
|
+
height: number
|
|
87
|
+
rowIndex: number
|
|
88
|
+
columnIndex: number
|
|
89
|
+
rowOffset: string
|
|
90
|
+
columnOffset: string
|
|
91
|
+
} | null
|
|
92
|
+
>(null)
|
|
93
|
+
const active = ref<
|
|
94
|
+
{
|
|
95
|
+
left: number
|
|
96
|
+
top: number
|
|
97
|
+
width: number
|
|
98
|
+
height: number
|
|
99
|
+
rowIndex: number
|
|
100
|
+
columnIndex: number
|
|
101
|
+
menuLeft: string
|
|
102
|
+
menuTop: string
|
|
103
|
+
} | null
|
|
104
|
+
>(null)
|
|
105
|
+
const activeKey = ref('')
|
|
51
106
|
|
|
52
107
|
/** Dispatches a component event to Vue listeners and, for controllers and page code, on the root. */
|
|
53
|
-
|
|
54
|
-
const declared
|
|
108
|
+
function dispatch(name: string, detail?: unknown): boolean {
|
|
109
|
+
const declared: Record<string, EventInit | undefined> = {
|
|
110
|
+
action: { bubbles: true, composed: true, cancelable: false },
|
|
111
|
+
}
|
|
55
112
|
const checks: Record<string, (detail: unknown) => boolean> = {
|
|
56
|
-
|
|
57
|
-
|
|
113
|
+
action: (detail) =>
|
|
114
|
+
(detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
115
|
+
&& ((detail as Record<string, unknown>)['action'] === 'add-row-before'
|
|
116
|
+
|| (detail as Record<string, unknown>)['action'] === 'add-row-after'
|
|
117
|
+
|| (detail as Record<string, unknown>)['action'] === 'add-column-before'
|
|
118
|
+
|| (detail as Record<string, unknown>)['action'] === 'add-column-after')
|
|
119
|
+
&& Number.isInteger((detail as Record<string, unknown>)['boundaryIndex'])
|
|
120
|
+
&& Object.keys(detail as object).every((key) => ['action', 'boundaryIndex'].includes(key)))
|
|
121
|
+
|| (detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
122
|
+
&& ((detail as Record<string, unknown>)['action'] === 'select-row'
|
|
123
|
+
|| (detail as Record<string, unknown>)['action'] === 'select-column')
|
|
124
|
+
&& Number.isInteger((detail as Record<string, unknown>)['rowIndex'])
|
|
125
|
+
&& Number.isInteger((detail as Record<string, unknown>)['columnIndex'])
|
|
126
|
+
&& Object.keys(detail as object).every((key) =>
|
|
127
|
+
['action', 'rowIndex', 'columnIndex'].includes(key)
|
|
128
|
+
))
|
|
129
|
+
|| (detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
130
|
+
&& (detail as Record<string, unknown>)['action'] === 'open-cell-menu'
|
|
131
|
+
&& Number.isInteger((detail as Record<string, unknown>)['rowIndex'])
|
|
132
|
+
&& Number.isInteger((detail as Record<string, unknown>)['columnIndex'])
|
|
133
|
+
&& ((detail as Record<string, unknown>)['anchor'] !== null
|
|
134
|
+
&& typeof (detail as Record<string, unknown>)['anchor'] === 'object'
|
|
135
|
+
&& !Array.isArray((detail as Record<string, unknown>)['anchor'])
|
|
136
|
+
&& (typeof ((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)[
|
|
137
|
+
'left'
|
|
138
|
+
] === 'number'
|
|
139
|
+
&& Number.isFinite(
|
|
140
|
+
((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)['left'],
|
|
141
|
+
))
|
|
142
|
+
&& (typeof ((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)[
|
|
143
|
+
'top'
|
|
144
|
+
] === 'number'
|
|
145
|
+
&& Number.isFinite(
|
|
146
|
+
((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)['top'],
|
|
147
|
+
))
|
|
148
|
+
&& (typeof ((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)[
|
|
149
|
+
'right'
|
|
150
|
+
] === 'number'
|
|
151
|
+
&& Number.isFinite(
|
|
152
|
+
((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)['right'],
|
|
153
|
+
))
|
|
154
|
+
&& (typeof ((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)[
|
|
155
|
+
'bottom'
|
|
156
|
+
] === 'number'
|
|
157
|
+
&& Number.isFinite(
|
|
158
|
+
((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)['bottom'],
|
|
159
|
+
))
|
|
160
|
+
&& Object.keys((detail as Record<string, unknown>)['anchor'] as object).every((key) =>
|
|
161
|
+
['left', 'top', 'right', 'bottom'].includes(key)
|
|
162
|
+
))
|
|
163
|
+
&& Object.keys(detail as object).every((key) =>
|
|
164
|
+
['action', 'rowIndex', 'columnIndex', 'anchor'].includes(key)
|
|
165
|
+
)),
|
|
166
|
+
}
|
|
58
167
|
if (detail !== undefined && checks[name] !== undefined && !checks[name]!(detail)) {
|
|
59
|
-
throw new TypeError(`HR002: Event \`${name}\` detail does not satisfy its declared type.`)
|
|
168
|
+
throw new TypeError(`HR002: Event \`${name}\` detail does not satisfy its declared type.`)
|
|
60
169
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
170
|
+
const emitEvent = emit as (name: string, detail: unknown) => void
|
|
171
|
+
emitEvent(name, detail)
|
|
172
|
+
return root.value?.dispatchEvent(
|
|
173
|
+
new CustomEvent(name, { bubbles: true, composed: true, ...declared[name], detail }),
|
|
174
|
+
) ?? true
|
|
175
|
+
}
|
|
64
176
|
|
|
65
177
|
function read(name: string): unknown {
|
|
66
|
-
if (name ===
|
|
67
|
-
if (name ===
|
|
68
|
-
if (name ===
|
|
69
|
-
if (name ===
|
|
70
|
-
if (name ===
|
|
71
|
-
return (props as Record<string, unknown>)[name]
|
|
178
|
+
if (name === 'rows') return rows.value
|
|
179
|
+
if (name === 'cols') return cols.value
|
|
180
|
+
if (name === 'hovered') return hovered.value
|
|
181
|
+
if (name === 'active') return active.value
|
|
182
|
+
if (name === 'activeKey') return activeKey.value
|
|
183
|
+
return (props as Record<string, unknown>)[name]
|
|
72
184
|
}
|
|
73
185
|
|
|
74
186
|
function write(name: string, value: unknown): boolean {
|
|
75
|
-
if (name ===
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (name ===
|
|
80
|
-
|
|
187
|
+
if (name === 'rows') {
|
|
188
|
+
rows.value = value as never
|
|
189
|
+
return true
|
|
190
|
+
}
|
|
191
|
+
if (name === 'cols') {
|
|
192
|
+
cols.value = value as never
|
|
193
|
+
return true
|
|
194
|
+
}
|
|
195
|
+
if (name === 'hovered') {
|
|
196
|
+
hovered.value = value as never
|
|
197
|
+
return true
|
|
198
|
+
}
|
|
199
|
+
if (name === 'active') {
|
|
200
|
+
active.value = value as never
|
|
201
|
+
return true
|
|
202
|
+
}
|
|
203
|
+
if (name === 'activeKey') {
|
|
204
|
+
activeKey.value = value as never
|
|
205
|
+
return true
|
|
206
|
+
}
|
|
207
|
+
throw new TypeError(`Only declared state is writable; \`${name}\` is not.`)
|
|
81
208
|
}
|
|
82
209
|
|
|
83
|
-
const stops: Array<() => void> = []
|
|
210
|
+
const stops: Array<() => void> = []
|
|
84
211
|
const host = {
|
|
85
|
-
get element(): Element {
|
|
212
|
+
get element(): Element {
|
|
213
|
+
return root.value as Element
|
|
214
|
+
},
|
|
86
215
|
state: new Proxy({} as Record<string, unknown>, {
|
|
87
|
-
get: (_target, name) => typeof name ===
|
|
88
|
-
set: (_target, name, value) => typeof name ===
|
|
216
|
+
get: (_target, name) => typeof name === 'string' ? read(name) : undefined,
|
|
217
|
+
set: (_target, name, value) => typeof name === 'string' && write(name, value),
|
|
89
218
|
}),
|
|
90
|
-
refs:
|
|
219
|
+
refs: {} as Readonly<Record<string, Element>>,
|
|
91
220
|
elements: new Proxy({} as Record<string, Element | RadioNodeList | undefined>, {
|
|
92
221
|
get: (_target, name) => {
|
|
93
|
-
if (typeof name !==
|
|
94
|
-
const form = root.value instanceof HTMLFormElement
|
|
95
|
-
|
|
222
|
+
if (typeof name !== 'string' || root.value === null) return undefined
|
|
223
|
+
const form = root.value instanceof HTMLFormElement
|
|
224
|
+
? root.value
|
|
225
|
+
: root.value.querySelector('form')
|
|
226
|
+
return form?.elements.namedItem(name)
|
|
227
|
+
?? root.value.querySelector(`[name="${CSS.escape(name)}"]`) ?? undefined
|
|
96
228
|
},
|
|
97
229
|
}),
|
|
98
230
|
signal<T>(initialValue: T) {
|
|
99
|
-
const value = shallowRef(initialValue)
|
|
231
|
+
const value = shallowRef(initialValue)
|
|
100
232
|
return {
|
|
101
233
|
get: (): T => value.value,
|
|
102
|
-
set: (next: T): void => {
|
|
103
|
-
|
|
104
|
-
|
|
234
|
+
set: (next: T): void => {
|
|
235
|
+
if (!Object.is(value.value, next)) value.value = next
|
|
236
|
+
},
|
|
237
|
+
update: (next: (current: T) => T): void => {
|
|
238
|
+
const updated = next(value.value)
|
|
239
|
+
if (!Object.is(value.value, updated)) value.value = updated
|
|
240
|
+
},
|
|
241
|
+
}
|
|
105
242
|
},
|
|
106
243
|
computed<T>(compute: () => T) {
|
|
107
|
-
const value = computed(compute)
|
|
108
|
-
return { get: (): T => value.value }
|
|
244
|
+
const value = computed(compute)
|
|
245
|
+
return { get: (): T => value.value }
|
|
109
246
|
},
|
|
110
247
|
effect(run: () => void | (() => void)): () => void {
|
|
111
248
|
const stop = watchEffect((onCleanup) => {
|
|
112
|
-
const cleanup = run()
|
|
113
|
-
if (typeof cleanup ===
|
|
114
|
-
}, { flush:
|
|
115
|
-
stops.push(stop)
|
|
116
|
-
return stop
|
|
249
|
+
const cleanup = run()
|
|
250
|
+
if (typeof cleanup === 'function') onCleanup(cleanup)
|
|
251
|
+
}, { flush: 'post' })
|
|
252
|
+
stops.push(stop)
|
|
253
|
+
return stop
|
|
117
254
|
},
|
|
118
255
|
on(event: string, listener: EventListener): () => void {
|
|
119
|
-
const element = root.value
|
|
120
|
-
element?.addEventListener(event, listener)
|
|
121
|
-
const off = (): void => element?.removeEventListener(event, listener)
|
|
122
|
-
stops.push(off)
|
|
123
|
-
return off
|
|
256
|
+
const element = root.value
|
|
257
|
+
element?.addEventListener(event, listener)
|
|
258
|
+
const off = (): void => element?.removeEventListener(event, listener)
|
|
259
|
+
stops.push(off)
|
|
260
|
+
return off
|
|
124
261
|
},
|
|
125
262
|
dispatch,
|
|
126
|
-
}
|
|
263
|
+
}
|
|
127
264
|
|
|
128
|
-
let cleanup: void | (() => void)
|
|
129
|
-
let ready: Promise<void> | undefined
|
|
265
|
+
let cleanup: void | (() => void)
|
|
266
|
+
let ready: Promise<void> | undefined
|
|
130
267
|
onMounted(() => {
|
|
131
|
-
ready = Promise.resolve(controllerModule.default(host as never)).then((result) => {
|
|
132
|
-
|
|
268
|
+
ready = Promise.resolve(controllerModule.default(host as never)).then((result) => {
|
|
269
|
+
cleanup = result
|
|
270
|
+
})
|
|
271
|
+
})
|
|
133
272
|
onBeforeUnmount(() => {
|
|
134
|
-
for (const stop of stops.splice(0)) stop()
|
|
135
|
-
if (typeof cleanup ===
|
|
136
|
-
})
|
|
273
|
+
for (const stop of stops.splice(0)) stop()
|
|
274
|
+
if (typeof cleanup === 'function') cleanup()
|
|
275
|
+
})
|
|
137
276
|
</script>
|
|
138
277
|
|
|
139
278
|
<template>
|
|
140
|
-
<div
|
|
279
|
+
<div
|
|
280
|
+
data-component="ui-editor-table-overlay"
|
|
281
|
+
aria-label="Table controls"
|
|
282
|
+
v-bind="$attrs"
|
|
283
|
+
:hidden="!open"
|
|
284
|
+
ref="root"
|
|
285
|
+
>
|
|
286
|
+
<div class="rows">
|
|
287
|
+
<div
|
|
288
|
+
v-for="control in rows"
|
|
289
|
+
:key="control.key"
|
|
290
|
+
class="control row"
|
|
291
|
+
:data-control-key="control.key"
|
|
292
|
+
:class="{ active: control.key === activeKey }"
|
|
293
|
+
:style="{ top: control.offset }"
|
|
294
|
+
>
|
|
295
|
+
<span class="line" aria-hidden="true"></span>
|
|
296
|
+
<span class="guide" data-ui-guide="" aria-hidden="true"></span>
|
|
297
|
+
<button
|
|
298
|
+
type="button"
|
|
299
|
+
class="handle"
|
|
300
|
+
:data-ui-affordance="control.affordance"
|
|
301
|
+
:data-action="control.action"
|
|
302
|
+
:data-boundary-index="control.index"
|
|
303
|
+
:aria-label="control.label"
|
|
304
|
+
>
|
|
305
|
+
<UiIcon name="plus" />
|
|
306
|
+
<span class="tooltip" role="tooltip">{{ control.label }}</span>
|
|
307
|
+
</button>
|
|
308
|
+
</div>
|
|
309
|
+
</div>
|
|
310
|
+
<div class="cols">
|
|
311
|
+
<div
|
|
312
|
+
v-for="control in cols"
|
|
313
|
+
:key="control.key"
|
|
314
|
+
class="control col"
|
|
315
|
+
:data-control-key="control.key"
|
|
316
|
+
:class="{ active: control.key === activeKey }"
|
|
317
|
+
:style="{ left: control.offset }"
|
|
318
|
+
>
|
|
319
|
+
<span class="line" aria-hidden="true"></span>
|
|
320
|
+
<span class="guide" data-ui-guide="" aria-hidden="true"></span>
|
|
321
|
+
<button
|
|
322
|
+
type="button"
|
|
323
|
+
class="handle"
|
|
324
|
+
:data-ui-affordance="control.affordance"
|
|
325
|
+
:data-action="control.action"
|
|
326
|
+
:data-boundary-index="control.index"
|
|
327
|
+
:aria-label="control.label"
|
|
328
|
+
>
|
|
329
|
+
<UiIcon name="plus" />
|
|
330
|
+
<span class="tooltip" role="tooltip">{{ control.label }}</span>
|
|
331
|
+
</button>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
<template v-if="hovered"><button
|
|
335
|
+
type="button"
|
|
336
|
+
class="selector row"
|
|
337
|
+
data-action="select-row"
|
|
338
|
+
title="Select row"
|
|
339
|
+
aria-label="Select row"
|
|
340
|
+
:data-row-index="hovered?.rowIndex"
|
|
341
|
+
:data-column-index="hovered?.columnIndex"
|
|
342
|
+
:style="{ top: hovered?.rowOffset }"
|
|
343
|
+
>
|
|
344
|
+
<span class="glyph"><UiIcon name="grip-vertical" /></span>
|
|
345
|
+
</button>
|
|
346
|
+
<button
|
|
347
|
+
type="button"
|
|
348
|
+
class="selector column"
|
|
349
|
+
data-action="select-column"
|
|
350
|
+
title="Select column"
|
|
351
|
+
aria-label="Select column"
|
|
352
|
+
:data-row-index="hovered?.rowIndex"
|
|
353
|
+
:data-column-index="hovered?.columnIndex"
|
|
354
|
+
:style="{ left: hovered?.columnOffset }"
|
|
355
|
+
>
|
|
356
|
+
<span class="glyph"><UiIcon name="grip-horizontal" /></span>
|
|
357
|
+
</button></template>
|
|
358
|
+
<button
|
|
359
|
+
v-if="active"
|
|
360
|
+
type="button"
|
|
361
|
+
class="cell-menu"
|
|
362
|
+
data-action="open-cell-menu"
|
|
363
|
+
title="Cell actions"
|
|
364
|
+
aria-label="Cell actions"
|
|
365
|
+
:data-row-index="active?.rowIndex"
|
|
366
|
+
:data-column-index="active?.columnIndex"
|
|
367
|
+
:style="{ left: active?.menuLeft, top: active?.menuTop }"
|
|
368
|
+
>
|
|
369
|
+
<UiIcon name="chevron-down" />
|
|
370
|
+
</button>
|
|
371
|
+
</div>
|
|
141
372
|
</template>
|
|
142
373
|
|
|
143
374
|
<style scoped>
|
|
144
375
|
[data-component~="ui-editor-table-overlay"] {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
376
|
+
display: block;
|
|
377
|
+
width: 100%;
|
|
378
|
+
height: 100%;
|
|
379
|
+
overflow: visible;
|
|
380
|
+
pointer-events: none;
|
|
381
|
+
}
|
|
151
382
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
383
|
+
[data-component~="ui-editor-table-overlay"] {
|
|
384
|
+
position: relative;
|
|
385
|
+
width: 100%;
|
|
386
|
+
height: 100%;
|
|
387
|
+
overflow: visible;
|
|
388
|
+
pointer-events: none;
|
|
389
|
+
}
|
|
159
390
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
391
|
+
.rows,
|
|
392
|
+
.cols {
|
|
393
|
+
pointer-events: none;
|
|
394
|
+
position: absolute;
|
|
395
|
+
}
|
|
165
396
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
397
|
+
.rows {
|
|
398
|
+
inset: 0;
|
|
399
|
+
width: 100%;
|
|
400
|
+
}
|
|
170
401
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
402
|
+
.cols {
|
|
403
|
+
inset: 0;
|
|
404
|
+
height: 100%;
|
|
405
|
+
}
|
|
175
406
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
407
|
+
.control {
|
|
408
|
+
position: absolute;
|
|
409
|
+
z-index: 1;
|
|
410
|
+
pointer-events: none;
|
|
411
|
+
}
|
|
181
412
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
413
|
+
.handle {
|
|
414
|
+
position: absolute;
|
|
415
|
+
display: inline-flex;
|
|
416
|
+
align-items: center;
|
|
417
|
+
justify-content: center;
|
|
418
|
+
width: 24px;
|
|
419
|
+
height: 24px;
|
|
420
|
+
padding: 0;
|
|
421
|
+
border: 1px solid var(--ui-affordance-near-color, var(--ui-border-strong, #c8c8c4));
|
|
422
|
+
border-radius: var(--ui-radius-round, 999px);
|
|
423
|
+
background: color-mix(in srgb, var(--ui-surface-elevated, #fff) 96%, transparent);
|
|
424
|
+
color: var(--ui-affordance-near-color, var(--ui-text-secondary, #5c5c5c));
|
|
425
|
+
font: inherit;
|
|
426
|
+
font-size: 16px;
|
|
427
|
+
line-height: 1;
|
|
428
|
+
box-shadow: var(--ui-shadow-xs, 0 1px 2px rgb(0 0 0 / 0.05));
|
|
429
|
+
opacity: 0;
|
|
430
|
+
scale: 0.72;
|
|
431
|
+
transition:
|
|
432
|
+
opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
|
|
433
|
+
scale var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
|
|
434
|
+
color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
|
|
435
|
+
background-color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
|
|
436
|
+
var(--ui-motion-ease, ease),
|
|
437
|
+
border-color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
|
|
438
|
+
var(--ui-motion-ease, ease);
|
|
439
|
+
pointer-events: auto;
|
|
440
|
+
cursor: pointer;
|
|
441
|
+
}
|
|
209
442
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
443
|
+
.handle {
|
|
444
|
+
--ui-icon-size: 14px;
|
|
445
|
+
--ui-icon-stroke-width: var(--ui-editor-table-affordance-icon-stroke-width, 2);
|
|
446
|
+
}
|
|
214
447
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
448
|
+
.handle[data-ui-proximity="near"],
|
|
449
|
+
.control.active .handle,
|
|
450
|
+
.handle:focus-visible {
|
|
451
|
+
opacity: 1;
|
|
452
|
+
scale: 1;
|
|
453
|
+
}
|
|
221
454
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
455
|
+
.control.active .handle,
|
|
456
|
+
.handle:focus-visible {
|
|
457
|
+
border-color: var(--ui-affordance-direct-color, var(--ui-accent-solid, #5b55d6));
|
|
458
|
+
background: var(--ui-affordance-direct-color, var(--ui-accent-solid, #5b55d6));
|
|
459
|
+
color: var(--ui-text-on-accent, #fff);
|
|
460
|
+
box-shadow: var(--ui-shadow-sm, 0 1px 3px rgb(0 0 0 / 0.1));
|
|
461
|
+
}
|
|
229
462
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
463
|
+
.handle:focus-visible,
|
|
464
|
+
.selector:focus-visible,
|
|
465
|
+
.cell-menu:focus-visible {
|
|
466
|
+
outline: 2px solid var(--ui-focus-ring, #5b55d6);
|
|
467
|
+
outline-offset: 2px;
|
|
468
|
+
}
|
|
236
469
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
470
|
+
.control.row {
|
|
471
|
+
left: 0;
|
|
472
|
+
width: 100%;
|
|
473
|
+
height: 0;
|
|
474
|
+
}
|
|
242
475
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
476
|
+
.control.row .handle {
|
|
477
|
+
top: -12px;
|
|
478
|
+
left: -30px;
|
|
479
|
+
}
|
|
247
480
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
481
|
+
.control.col {
|
|
482
|
+
top: 0;
|
|
483
|
+
width: 0;
|
|
484
|
+
height: 100%;
|
|
485
|
+
}
|
|
253
486
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
487
|
+
.control.col .handle {
|
|
488
|
+
top: -30px;
|
|
489
|
+
left: -12px;
|
|
490
|
+
}
|
|
258
491
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
492
|
+
.line {
|
|
493
|
+
position: absolute;
|
|
494
|
+
background: var(--ui-affordance-direct-color, var(--ui-accent-solid, #5b55d6));
|
|
495
|
+
opacity: 0;
|
|
496
|
+
transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
|
|
497
|
+
var(--ui-motion-ease, ease);
|
|
498
|
+
}
|
|
265
499
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
500
|
+
.control.row .line {
|
|
501
|
+
inset: -1px 0 auto;
|
|
502
|
+
height: 2px;
|
|
503
|
+
}
|
|
270
504
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
505
|
+
.control.col .line {
|
|
506
|
+
inset: 0 auto 0 -1px;
|
|
507
|
+
width: 2px;
|
|
508
|
+
}
|
|
275
509
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
510
|
+
.control.active .line {
|
|
511
|
+
opacity: 0.8;
|
|
512
|
+
}
|
|
279
513
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
514
|
+
.guide {
|
|
515
|
+
position: absolute;
|
|
516
|
+
width: var(--ui-affordance-guide-size, 4px);
|
|
517
|
+
height: var(--ui-affordance-guide-size, 4px);
|
|
518
|
+
border-radius: var(--ui-radius-round, 999px);
|
|
519
|
+
background: var(--ui-affordance-guide-color, var(--ui-border-strong, #c8c8c4));
|
|
520
|
+
opacity: var(--ui-affordance-guide-opacity, 0.42);
|
|
521
|
+
transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
|
|
522
|
+
var(--ui-motion-ease, ease);
|
|
523
|
+
}
|
|
289
524
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
525
|
+
.control.row .guide {
|
|
526
|
+
left: -10px;
|
|
527
|
+
top: -2px;
|
|
528
|
+
}
|
|
294
529
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
530
|
+
.control.col .guide {
|
|
531
|
+
left: -2px;
|
|
532
|
+
top: -10px;
|
|
533
|
+
}
|
|
299
534
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
535
|
+
.control:has(.handle[data-ui-proximity="near"]) .guide,
|
|
536
|
+
.control.active .guide {
|
|
537
|
+
opacity: 0;
|
|
538
|
+
}
|
|
304
539
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
540
|
+
.tooltip {
|
|
541
|
+
position: absolute;
|
|
542
|
+
z-index: 2;
|
|
543
|
+
top: calc(100% + 6px);
|
|
544
|
+
left: 50%;
|
|
545
|
+
width: max-content;
|
|
546
|
+
max-width: 14rem;
|
|
547
|
+
padding: var(--ui-space-1, 4px) var(--ui-space-2, 8px);
|
|
548
|
+
border-radius: var(--ui-radius-1, 4px);
|
|
549
|
+
background: var(--ui-text-primary, #1a1a1a);
|
|
550
|
+
color: var(--ui-surface-elevated, #fff);
|
|
551
|
+
font-size: var(--ui-font-size-xs, 0.75rem);
|
|
552
|
+
font-weight: var(--ui-font-medium, 500);
|
|
553
|
+
line-height: var(--ui-line-height-md, 1.4);
|
|
554
|
+
opacity: 0;
|
|
555
|
+
transform: translateX(-50%);
|
|
556
|
+
transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
|
|
557
|
+
var(--ui-motion-ease, ease);
|
|
558
|
+
pointer-events: none;
|
|
559
|
+
}
|
|
324
560
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
561
|
+
.control.row .tooltip {
|
|
562
|
+
top: 50%;
|
|
563
|
+
left: auto;
|
|
564
|
+
right: calc(100% + 8px);
|
|
565
|
+
transform: translateY(-50%);
|
|
566
|
+
}
|
|
331
567
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
568
|
+
.control.active .tooltip,
|
|
569
|
+
.handle:focus-visible .tooltip {
|
|
570
|
+
opacity: 1;
|
|
571
|
+
}
|
|
336
572
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
573
|
+
.selector,
|
|
574
|
+
.cell-menu {
|
|
575
|
+
position: absolute;
|
|
576
|
+
z-index: 2;
|
|
577
|
+
display: inline-flex;
|
|
578
|
+
align-items: center;
|
|
579
|
+
justify-content: center;
|
|
580
|
+
padding: 0;
|
|
581
|
+
border: 1px solid transparent;
|
|
582
|
+
background: transparent;
|
|
583
|
+
color: var(--ui-text-secondary, #5c5c5c);
|
|
584
|
+
box-shadow: none;
|
|
585
|
+
pointer-events: auto;
|
|
586
|
+
cursor: pointer;
|
|
587
|
+
transition:
|
|
588
|
+
color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
|
|
589
|
+
background-color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
|
|
590
|
+
var(--ui-motion-ease, ease),
|
|
591
|
+
border-color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
|
|
592
|
+
var(--ui-motion-ease, ease),
|
|
593
|
+
box-shadow var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
|
|
594
|
+
var(--ui-motion-ease, ease);
|
|
595
|
+
}
|
|
357
596
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
597
|
+
.selector:hover,
|
|
598
|
+
.cell-menu:hover {
|
|
599
|
+
background: var(--ui-icon-button-hover-bg, var(--ui-surface-muted, #f3f4f6));
|
|
600
|
+
color: var(--ui-icon-button-hover-color, var(--ui-text-primary, #1a1a1a));
|
|
601
|
+
box-shadow: var(--ui-shadow-xs, 0 1px 2px rgb(0 0 0 / 0.05));
|
|
602
|
+
}
|
|
364
603
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
604
|
+
.selector {
|
|
605
|
+
border-radius: var(--ui-radius-round, 999px);
|
|
606
|
+
}
|
|
368
607
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
608
|
+
.selector::before {
|
|
609
|
+
content: "";
|
|
610
|
+
position: absolute;
|
|
611
|
+
inset: 50% auto auto 50%;
|
|
612
|
+
border-radius: var(--ui-radius-round, 999px);
|
|
613
|
+
background: var(--ui-affordance-guide-color, var(--ui-border-strong, #c8c8c4));
|
|
614
|
+
opacity: var(--ui-affordance-guide-opacity, 0.42);
|
|
615
|
+
transform: translate(-50%, -50%);
|
|
616
|
+
transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
|
|
617
|
+
var(--ui-motion-ease, ease);
|
|
618
|
+
pointer-events: none;
|
|
619
|
+
}
|
|
380
620
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
621
|
+
.selector .glyph {
|
|
622
|
+
display: block;
|
|
623
|
+
width: 14px;
|
|
624
|
+
height: 14px;
|
|
625
|
+
--ui-icon-size: 14px;
|
|
626
|
+
--ui-icon-stroke-width: var(--ui-editor-table-affordance-icon-stroke-width, 2);
|
|
627
|
+
opacity: 0;
|
|
628
|
+
transform: scale(0.72);
|
|
629
|
+
transition:
|
|
630
|
+
opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
|
|
631
|
+
transform var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease);
|
|
632
|
+
}
|
|
393
633
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
634
|
+
.selector:hover::before,
|
|
635
|
+
.selector:focus-visible::before {
|
|
636
|
+
opacity: 0;
|
|
637
|
+
}
|
|
398
638
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
639
|
+
.selector:hover .glyph,
|
|
640
|
+
.selector:focus-visible .glyph {
|
|
641
|
+
opacity: 1;
|
|
642
|
+
transform: scale(1);
|
|
643
|
+
}
|
|
404
644
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
645
|
+
.selector.row {
|
|
646
|
+
left: -9px;
|
|
647
|
+
width: 18px;
|
|
648
|
+
height: 32px;
|
|
649
|
+
transform: translateY(-50%);
|
|
650
|
+
}
|
|
411
651
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
652
|
+
.selector.row::before {
|
|
653
|
+
width: 2px;
|
|
654
|
+
height: 16px;
|
|
655
|
+
}
|
|
416
656
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
657
|
+
.selector.column {
|
|
658
|
+
top: -9px;
|
|
659
|
+
width: 32px;
|
|
660
|
+
height: 18px;
|
|
661
|
+
transform: translateX(-50%);
|
|
662
|
+
}
|
|
423
663
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
664
|
+
.selector.column::before {
|
|
665
|
+
width: 16px;
|
|
666
|
+
height: 2px;
|
|
667
|
+
}
|
|
428
668
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
669
|
+
@media (hover: none), (pointer: coarse) {
|
|
670
|
+
.selector::before {
|
|
671
|
+
opacity: 0;
|
|
672
|
+
}
|
|
433
673
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
674
|
+
.selector .glyph {
|
|
675
|
+
opacity: 1;
|
|
676
|
+
transform: none;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
439
679
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
680
|
+
.cell-menu {
|
|
681
|
+
width: 24px;
|
|
682
|
+
height: 24px;
|
|
683
|
+
border-radius: var(--ui-radius-1, 4px);
|
|
684
|
+
background: color-mix(in srgb, var(--ui-surface-muted, #f3f4f6) 78%, transparent);
|
|
685
|
+
}
|
|
446
686
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
687
|
+
.cell-menu {
|
|
688
|
+
--ui-icon-size: 15px;
|
|
689
|
+
--ui-icon-stroke-width: var(--ui-editor-table-affordance-icon-stroke-width, 2);
|
|
690
|
+
}
|
|
451
691
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
692
|
+
[data-component~="ui-editor-table-overlay"][hidden] {
|
|
693
|
+
display: none;
|
|
694
|
+
}
|
|
455
695
|
</style>
|