@formicoidea/labre-core 0.60.0 → 0.61.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.
Files changed (62) hide show
  1. package/architecture/code.c4 +28 -23
  2. package/architecture/likec4.config.json +3 -3
  3. package/dist/_pkgs/affine-block-attachment/asset-picker.d.ts +8 -0
  4. package/dist/_pkgs/affine-block-attachment/asset-picker.js +25 -1
  5. package/dist/_pkgs/affine-block-attachment/attachment-block.js +9 -7
  6. package/dist/_pkgs/affine-block-database/database-block.js +4 -5
  7. package/dist/_pkgs/affine-block-database/service/index.d.ts +1 -0
  8. package/dist/_pkgs/affine-block-database/service/index.js +1 -0
  9. package/dist/_pkgs/affine-block-database/service/initial-view.d.ts +33 -0
  10. package/dist/_pkgs/affine-block-database/service/initial-view.js +20 -0
  11. package/dist/_pkgs/affine-block-database/utils/current-view.d.ts +7 -0
  12. package/dist/_pkgs/affine-block-database/utils/current-view.js +14 -0
  13. package/dist/_pkgs/affine-block-embed/common/render-linked-doc.js +2 -0
  14. package/dist/_pkgs/affine-block-embed-doc/common/child-card.d.ts +25 -0
  15. package/dist/_pkgs/affine-block-embed-doc/common/child-card.js +27 -0
  16. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/commands/insert-embed-linked-doc.js +6 -1
  17. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/new-doc.js +2 -2
  18. package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +2 -6
  19. package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +2 -3
  20. package/dist/_pkgs/affine-block-embed-doc/page-drop/page-drop.js +3 -3
  21. package/dist/_pkgs/affine-block-surface/extensions/reading-toolbar.js +12 -12
  22. package/dist/_pkgs/affine-components/highlight-dropdown-menu/highlight-duotone-icon.js +8 -8
  23. package/dist/_pkgs/affine-components/highlight-dropdown-menu/text-duotone-icon.js +11 -11
  24. package/dist/_pkgs/affine-components/icons/loading.d.ts +6 -0
  25. package/dist/_pkgs/affine-components/icons/loading.js +16 -12
  26. package/dist/_pkgs/affine-fragment-doc-title/title-band/show-here.js +2 -2
  27. package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.d.ts +8 -0
  28. package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.js +35 -13
  29. package/dist/_pkgs/affine-fragment-doc-title/translations.d.ts +1 -1
  30. package/dist/_pkgs/affine-fragment-doc-title/translations.js +1 -1
  31. package/dist/_pkgs/affine-gfx-mindmap/toolbar/basket-elements.d.ts +12 -0
  32. package/dist/_pkgs/affine-gfx-mindmap/toolbar/basket-elements.js +44 -5
  33. package/dist/_pkgs/affine-gfx-mindmap/toolbar/senior-tool.d.ts +3 -2
  34. package/dist/_pkgs/affine-gfx-mindmap/toolbar/senior-tool.js +3 -2
  35. package/dist/_pkgs/affine-gfx-template/builtin/slides/build.js +10 -10
  36. package/dist/_pkgs/affine-gfx-template/builtin/slides/consts.d.ts +48 -64
  37. package/dist/_pkgs/affine-gfx-template/builtin/slides/consts.js +24 -21
  38. package/dist/_pkgs/affine-gfx-template/builtin/slides/masks.d.ts +1 -2
  39. package/dist/_pkgs/affine-gfx-template/builtin/slides/masks.js +0 -34
  40. package/dist/_pkgs/affine-inline-reference/reference-node/configs/toolbar.js +2 -1
  41. package/dist/_pkgs/affine-shared/consts/index.d.ts +9 -0
  42. package/dist/_pkgs/affine-shared/consts/index.js +9 -0
  43. package/dist/_pkgs/affine-shared/services/asset-picker-service.d.ts +7 -6
  44. package/dist/_pkgs/affine-shared/services/asset-picker-service.js +5 -5
  45. package/dist/_pkgs/affine-shared/services/title-band-service.d.ts +19 -0
  46. package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/index.js +26 -26
  47. package/dist/_pkgs/affine-widget-keyboard-toolbar/icons.js +98 -98
  48. package/dist/_pkgs/affine-widget-page-dragging-area/index.js +10 -10
  49. package/dist/_pkgs/affine-widget-viewport-overlay/index.js +13 -13
  50. package/dist/_pkgs/data-view/core/component/cell-status/cell-status-css.d.ts +1 -1
  51. package/dist/_pkgs/data-view/core/component/cell-status/cell-status-css.js +10 -10
  52. package/dist/_pkgs/data-view/core/component/cell-status/cell-status.d.ts +1 -1
  53. package/dist/_pkgs/data-view/core/component/cell-status/cell-status.js +7 -5
  54. package/dist/_pkgs/data-view/core/utils/menu-title.js +17 -17
  55. package/dist/_pkgs/data-view/property-presets/number/cell-renderer.d.ts +18 -0
  56. package/dist/_pkgs/data-view/property-presets/number/cell-renderer.js +51 -10
  57. package/dist/_pkgs/data-view/property-presets/text/cell-renderer.d.ts +23 -1
  58. package/dist/_pkgs/data-view/property-presets/text/cell-renderer.js +56 -15
  59. package/dist/_pkgs/data-view/property-presets/typing-commit.d.ts +16 -0
  60. package/dist/_pkgs/data-view/property-presets/typing-commit.js +27 -0
  61. package/dist/_pkgs/data-view/view-presets/list/list-view.js +1 -1
  62. package/package.json +1 -1
@@ -19,105 +19,105 @@ export function HeadingIcon(i) {
19
19
  return Heading1Icon();
20
20
  }
21
21
  }
22
- export const HighLightDuotoneIcon = (color) => html `<svg
23
- xmlns="http://www.w3.org/2000/svg"
24
- width="24"
25
- height="24"
26
- viewBox="0 0 24 24"
27
- fill="none"
28
- >
29
- <path
30
- d="M5.8291 16.441L7.91757 18.5295L6.57811 19.8689C6.53119 19.9158 6.46406 19.9364 6.3989 19.9239L3.37036 19.3412C3.21285 19.3109 3.15331 19.1168 3.26673 19.0034L5.8291 16.441Z"
31
- fill="${color}"
32
- />
33
- <path
34
- fill-rule="evenodd"
35
- clip-rule="evenodd"
36
- d="M19.0095 3.63759C17.9526 2.58067 16.26 2.516 15.1255 3.48919L7.32135 10.1837C6.35438 11.0132 6.05275 12.3823 6.58163 13.5414L6.73501 13.8775L5.67697 14.9356C5.30169 15.3108 5.30169 15.9193 5.67697 16.2946L8.06379 18.6814C8.43907 19.0567 9.04752 19.0567 9.4228 18.6814L10.4808 17.6234L10.8171 17.7768C11.9761 18.3057 13.3452 18.0041 14.1747 17.0371L20.8692 9.23294C21.8424 8.09846 21.7778 6.40588 20.7208 5.34896L19.0095 3.63759ZM16.1021 4.62769C16.6415 4.16498 17.4463 4.19572 17.9488 4.69825L19.6602 6.40962C20.1627 6.91215 20.1935 7.7169 19.7307 8.25631L14.6424 14.188L10.1704 9.71604L16.1021 4.62769ZM9.02857 10.6955L8.29798 11.3222C7.83822 11.7166 7.6948 12.3676 7.94627 12.9187L8.29785 13.6892C8.4348 13.9893 8.37947 14.3544 8.13372 14.6001L7.11878 15.6151L8.74329 17.2396L9.75812 16.2247C10.004 15.9789 10.3691 15.9236 10.6693 16.0606L11.4398 16.4122C11.9908 16.6636 12.6418 16.5202 13.0362 16.0605L13.6629 15.3299L9.02857 10.6955Z"
37
- fill="${cssVarV2('icon/primary')}"
38
- />
22
+ export const HighLightDuotoneIcon = (color) => html `<svg
23
+ xmlns="http://www.w3.org/2000/svg"
24
+ width="24"
25
+ height="24"
26
+ viewBox="0 0 24 24"
27
+ fill="none"
28
+ >
29
+ <path
30
+ d="M5.8291 16.441L7.91757 18.5295L6.57811 19.8689C6.53119 19.9158 6.46406 19.9364 6.3989 19.9239L3.37036 19.3412C3.21285 19.3109 3.15331 19.1168 3.26673 19.0034L5.8291 16.441Z"
31
+ fill="${color}"
32
+ />
33
+ <path
34
+ fill-rule="evenodd"
35
+ clip-rule="evenodd"
36
+ d="M19.0095 3.63759C17.9526 2.58067 16.26 2.516 15.1255 3.48919L7.32135 10.1837C6.35438 11.0132 6.05275 12.3823 6.58163 13.5414L6.73501 13.8775L5.67697 14.9356C5.30169 15.3108 5.30169 15.9193 5.67697 16.2946L8.06379 18.6814C8.43907 19.0567 9.04752 19.0567 9.4228 18.6814L10.4808 17.6234L10.8171 17.7768C11.9761 18.3057 13.3452 18.0041 14.1747 17.0371L20.8692 9.23294C21.8424 8.09846 21.7778 6.40588 20.7208 5.34896L19.0095 3.63759ZM16.1021 4.62769C16.6415 4.16498 17.4463 4.19572 17.9488 4.69825L19.6602 6.40962C20.1627 6.91215 20.1935 7.7169 19.7307 8.25631L14.6424 14.188L10.1704 9.71604L16.1021 4.62769ZM9.02857 10.6955L8.29798 11.3222C7.83822 11.7166 7.6948 12.3676 7.94627 12.9187L8.29785 13.6892C8.4348 13.9893 8.37947 14.3544 8.13372 14.6001L7.11878 15.6151L8.74329 17.2396L9.75812 16.2247C10.004 15.9789 10.3691 15.9236 10.6693 16.0606L11.4398 16.4122C11.9908 16.6636 12.6418 16.5202 13.0362 16.0605L13.6629 15.3299L9.02857 10.6955Z"
37
+ fill="${cssVarV2('icon/primary')}"
38
+ />
39
39
  </svg>`;
40
- export const TextColorIcon = (color) => html `<svg
41
- xmlns="http://www.w3.org/2000/svg"
42
- width="32"
43
- height="32"
44
- viewBox="0 0 32 32"
45
- fill="none"
46
- >
47
- <path
48
- fill-rule="evenodd"
49
- clip-rule="evenodd"
50
- d="M14.0627 6.16255C14.385 5.30291 15.2068 4.7334 16.1249 4.7334C17.043 4.7334 17.8648 5.30291 18.1872 6.16255L23.7279 20.9378C23.9219 21.455 23.6599 22.0314 23.1427 22.2253C22.6256 22.4192 22.0492 22.1572 21.8553 21.6401L20.2289 17.3031H12.021L10.3946 21.6401C10.2007 22.1572 9.62428 22.4192 9.10716 22.2253C8.59004 22.0314 8.32803 21.455 8.52195 20.9378L14.0627 6.16255ZM12.771 15.3031H19.4789L16.3146 6.8648C16.2849 6.78576 16.2094 6.7334 16.1249 6.7334C16.0405 6.7334 15.965 6.78576 15.9353 6.8648L12.771 15.3031Z"
51
- fill="${cssVarV2('icon/primary')}"
52
- />
53
- <rect
54
- x="5.45837"
55
- y="24"
56
- width="21.3333"
57
- height="3.33333"
58
- rx="1"
59
- fill=${color}
60
- />
40
+ export const TextColorIcon = (color) => html `<svg
41
+ xmlns="http://www.w3.org/2000/svg"
42
+ width="32"
43
+ height="32"
44
+ viewBox="0 0 32 32"
45
+ fill="none"
46
+ >
47
+ <path
48
+ fill-rule="evenodd"
49
+ clip-rule="evenodd"
50
+ d="M14.0627 6.16255C14.385 5.30291 15.2068 4.7334 16.1249 4.7334C17.043 4.7334 17.8648 5.30291 18.1872 6.16255L23.7279 20.9378C23.9219 21.455 23.6599 22.0314 23.1427 22.2253C22.6256 22.4192 22.0492 22.1572 21.8553 21.6401L20.2289 17.3031H12.021L10.3946 21.6401C10.2007 22.1572 9.62428 22.4192 9.10716 22.2253C8.59004 22.0314 8.32803 21.455 8.52195 20.9378L14.0627 6.16255ZM12.771 15.3031H19.4789L16.3146 6.8648C16.2849 6.78576 16.2094 6.7334 16.1249 6.7334C16.0405 6.7334 15.965 6.78576 15.9353 6.8648L12.771 15.3031Z"
51
+ fill="${cssVarV2('icon/primary')}"
52
+ />
53
+ <rect
54
+ x="5.45837"
55
+ y="24"
56
+ width="21.3333"
57
+ height="3.33333"
58
+ rx="1"
59
+ fill=${color}
60
+ />
61
61
  </svg>`;
62
- export const TextBackgroundDuotoneIcon = (color) => html `<svg
63
- xmlns="http://www.w3.org/2000/svg"
64
- width="32"
65
- height="32"
66
- viewBox="0 0 32 32"
67
- fill="none"
68
- >
69
- <path
70
- fill-rule="evenodd"
71
- clip-rule="evenodd"
72
- d="M4.57507 7.33336C4.57507 5.60287 5.97791 4.20003 7.70841 4.20003H25.0417C26.7722 4.20003 28.1751 5.60287 28.1751 7.33336V24.6667C28.1751 26.3972 26.7722 27.8 25.0417 27.8H7.70841C5.97791 27.8 4.57507 26.3972 4.57507 24.6667V7.33336Z"
73
- fill="${color}"
74
- />
75
- <path
76
- fill-rule="evenodd"
77
- clip-rule="evenodd"
78
- d="M4.57495 7.33333C4.57495 5.60284 5.97779 4.2 7.70828 4.2H25.0416C26.7721 4.2 28.175 5.60284 28.175 7.33333V24.6667C28.175 26.3972 26.7721 27.8 25.0416 27.8H7.70828C5.97779 27.8 4.57495 26.3972 4.57495 24.6667V7.33333ZM7.70828 5.13333C6.49326 5.13333 5.50828 6.1183 5.50828 7.33333V24.6667C5.50828 25.8817 6.49326 26.8667 7.70828 26.8667H25.0416C26.2566 26.8667 27.2416 25.8817 27.2416 24.6667V7.33333C27.2416 6.1183 26.2566 5.13333 25.0416 5.13333H7.70828Z"
79
- fill="black"
80
- fill-opacity="0.22"
81
- />
82
- <path
83
- fill-rule="evenodd"
84
- clip-rule="evenodd"
85
- d="M14.5379 10.0064C14.8251 9.24064 15.5571 8.73332 16.375 8.73332C17.1928 8.73332 17.9249 9.24064 18.2121 10.0064L22.6446 21.8266C22.8386 22.3438 22.5766 22.9202 22.0594 23.1141C21.5423 23.308 20.9659 23.046 20.772 22.5289L19.5196 19.1891H13.2304L11.978 22.5289C11.7841 23.046 11.2076 23.308 10.6905 23.1141C10.1734 22.9202 9.9114 22.3438 10.1053 21.8266L14.5379 10.0064ZM13.9804 17.1891H18.7696L16.375 10.8035L13.9804 17.1891Z"
86
- fill="${cssVarV2('text/primary')}"
87
- />
62
+ export const TextBackgroundDuotoneIcon = (color) => html `<svg
63
+ xmlns="http://www.w3.org/2000/svg"
64
+ width="32"
65
+ height="32"
66
+ viewBox="0 0 32 32"
67
+ fill="none"
68
+ >
69
+ <path
70
+ fill-rule="evenodd"
71
+ clip-rule="evenodd"
72
+ d="M4.57507 7.33336C4.57507 5.60287 5.97791 4.20003 7.70841 4.20003H25.0417C26.7722 4.20003 28.1751 5.60287 28.1751 7.33336V24.6667C28.1751 26.3972 26.7722 27.8 25.0417 27.8H7.70841C5.97791 27.8 4.57507 26.3972 4.57507 24.6667V7.33336Z"
73
+ fill="${color}"
74
+ />
75
+ <path
76
+ fill-rule="evenodd"
77
+ clip-rule="evenodd"
78
+ d="M4.57495 7.33333C4.57495 5.60284 5.97779 4.2 7.70828 4.2H25.0416C26.7721 4.2 28.175 5.60284 28.175 7.33333V24.6667C28.175 26.3972 26.7721 27.8 25.0416 27.8H7.70828C5.97779 27.8 4.57495 26.3972 4.57495 24.6667V7.33333ZM7.70828 5.13333C6.49326 5.13333 5.50828 6.1183 5.50828 7.33333V24.6667C5.50828 25.8817 6.49326 26.8667 7.70828 26.8667H25.0416C26.2566 26.8667 27.2416 25.8817 27.2416 24.6667V7.33333C27.2416 6.1183 26.2566 5.13333 25.0416 5.13333H7.70828Z"
79
+ fill="black"
80
+ fill-opacity="0.22"
81
+ />
82
+ <path
83
+ fill-rule="evenodd"
84
+ clip-rule="evenodd"
85
+ d="M14.5379 10.0064C14.8251 9.24064 15.5571 8.73332 16.375 8.73332C17.1928 8.73332 17.9249 9.24064 18.2121 10.0064L22.6446 21.8266C22.8386 22.3438 22.5766 22.9202 22.0594 23.1141C21.5423 23.308 20.9659 23.046 20.772 22.5289L19.5196 19.1891H13.2304L11.978 22.5289C11.7841 23.046 11.2076 23.308 10.6905 23.1141C10.1734 22.9202 9.9114 22.3438 10.1053 21.8266L14.5379 10.0064ZM13.9804 17.1891H18.7696L16.375 10.8035L13.9804 17.1891Z"
86
+ fill="${cssVarV2('text/primary')}"
87
+ />
88
88
  </svg>`;
89
- export const FigmaDuotoneIcon = html `<svg
90
- width="32"
91
- height="32"
92
- viewBox="0 0 24 24"
93
- fill="none"
94
- xmlns="http://www.w3.org/2000/svg"
95
- >
96
- <g id="Figma_Duotone">
97
- <path
98
- id="Vector"
99
- d="M8.41842 22.5027C10.3047 22.5027 11.8356 20.9719 11.8356 19.0856V15.6685H8.41842C6.53216 15.6685 5.00128 17.1993 5.00128 19.0856C5.00128 20.9719 6.53216 22.5027 8.41842 22.5027Z"
100
- fill="#0ACF83"
101
- />
102
- <path
103
- id="Vector_2"
104
- d="M5.00128 12.2514C5.00128 10.3651 6.53216 8.83423 8.41842 8.83423H11.8356V15.6685H8.41842C6.53216 15.6685 5.00128 14.1376 5.00128 12.2514Z"
105
- fill="#A259FF"
106
- />
107
- <path
108
- id="Vector_3"
109
- d="M5.00146 5.41714C5.00146 3.53088 6.53234 2 8.4186 2H11.8357V8.83428H8.4186C6.53234 8.83428 5.00146 7.3034 5.00146 5.41714Z"
110
- fill="#F24E1E"
111
- />
112
- <path
113
- id="Vector_4"
114
- d="M11.8356 2H15.2527C17.139 2 18.6699 3.53088 18.6699 5.41714C18.6699 7.3034 17.139 8.83428 15.2527 8.83428H11.8356V2Z"
115
- fill="#FF7262"
116
- />
117
- <path
118
- id="Vector_5"
119
- d="M18.6699 12.2514C18.6699 14.1376 17.139 15.6685 15.2527 15.6685C13.3665 15.6685 11.8356 14.1376 11.8356 12.2514C11.8356 10.3651 13.3665 8.83423 15.2527 8.83423C17.139 8.83423 18.6699 10.3651 18.6699 12.2514Z"
120
- fill="#1ABCFE"
121
- />
122
- </g>
89
+ export const FigmaDuotoneIcon = html `<svg
90
+ width="32"
91
+ height="32"
92
+ viewBox="0 0 24 24"
93
+ fill="none"
94
+ xmlns="http://www.w3.org/2000/svg"
95
+ >
96
+ <g id="Figma_Duotone">
97
+ <path
98
+ id="Vector"
99
+ d="M8.41842 22.5027C10.3047 22.5027 11.8356 20.9719 11.8356 19.0856V15.6685H8.41842C6.53216 15.6685 5.00128 17.1993 5.00128 19.0856C5.00128 20.9719 6.53216 22.5027 8.41842 22.5027Z"
100
+ fill="#0ACF83"
101
+ />
102
+ <path
103
+ id="Vector_2"
104
+ d="M5.00128 12.2514C5.00128 10.3651 6.53216 8.83423 8.41842 8.83423H11.8356V15.6685H8.41842C6.53216 15.6685 5.00128 14.1376 5.00128 12.2514Z"
105
+ fill="#A259FF"
106
+ />
107
+ <path
108
+ id="Vector_3"
109
+ d="M5.00146 5.41714C5.00146 3.53088 6.53234 2 8.4186 2H11.8357V8.83428H8.4186C6.53234 8.83428 5.00146 7.3034 5.00146 5.41714Z"
110
+ fill="#F24E1E"
111
+ />
112
+ <path
113
+ id="Vector_4"
114
+ d="M11.8356 2H15.2527C17.139 2 18.6699 3.53088 18.6699 5.41714C18.6699 7.3034 17.139 8.83428 15.2527 8.83428H11.8356V2Z"
115
+ fill="#FF7262"
116
+ />
117
+ <path
118
+ id="Vector_5"
119
+ d="M18.6699 12.2514C18.6699 14.1376 17.139 15.6685 15.2527 15.6685C13.3665 15.6685 11.8356 14.1376 11.8356 12.2514C11.8356 10.3651 13.3665 8.83423 15.2527 8.83423C17.139 8.83423 18.6699 10.3651 18.6699 12.2514Z"
120
+ fill="#1ABCFE"
121
+ />
122
+ </g>
123
123
  </svg> `;
@@ -199,16 +199,16 @@ let AffinePageDraggingAreaWidget = (() => {
199
199
  width: rect.width + 'px',
200
200
  height: rect.height + 'px',
201
201
  };
202
- return html `
203
- <style>
204
- .affine-page-dragging-area {
205
- position: absolute;
206
- background: var(--affine-hover-color);
207
- z-index: 1;
208
- pointer-events: none;
209
- }
210
- </style>
211
- <div class="affine-page-dragging-area" style=${styleMap(style)}></div>
202
+ return html `
203
+ <style>
204
+ .affine-page-dragging-area {
205
+ position: absolute;
206
+ background: var(--affine-hover-color);
207
+ z-index: 1;
208
+ pointer-events: none;
209
+ }
210
+ </style>
211
+ <div class="affine-page-dragging-area" style=${styleMap(style)}></div>
212
212
  `;
213
213
  }
214
214
  #rect_accessor_storage;
@@ -51,19 +51,19 @@ let AffineViewportOverlayWidget = (() => {
51
51
  __esDecorate(this, null, __lockViewport_decorators, { kind: "accessor", name: "_lockViewport", static: false, private: false, access: { has: obj => "_lockViewport" in obj, get: obj => obj._lockViewport, set: (obj, value) => { obj._lockViewport = value; } }, metadata: _metadata }, __lockViewport_initializers, __lockViewport_extraInitializers);
52
52
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
53
53
  }
54
- static { this.styles = css `
55
- .affine-viewport-overlay-widget {
56
- position: absolute;
57
- top: 0;
58
- left: 0;
59
- background: transparent;
60
- pointer-events: none;
61
- z-index: calc(var(--affine-z-index-popover) - 1);
62
- }
63
-
64
- .affine-viewport-overlay-widget.lock {
65
- pointer-events: auto;
66
- }
54
+ static { this.styles = css `
55
+ .affine-viewport-overlay-widget {
56
+ position: absolute;
57
+ top: 0;
58
+ left: 0;
59
+ background: transparent;
60
+ pointer-events: none;
61
+ z-index: calc(var(--affine-z-index-popover) - 1);
62
+ }
63
+
64
+ .affine-viewport-overlay-widget.lock {
65
+ pointer-events: auto;
66
+ }
67
67
  `; }
68
68
  connectedCallback() {
69
69
  super.connectedCallback();
@@ -1,2 +1,2 @@
1
- export declare const cellSkeletonStyle: string;
1
+ export declare const cellLoadingStyle: string;
2
2
  export declare const cellEmptyStyle: string;
@@ -1,14 +1,14 @@
1
1
  import { css } from '@emotion/css';
2
- // The title band's loading chip, in a cell (`labre-title-band-skeleton`):
3
- // same hover tone, same radius, no motion to honour or disable.
4
- export const cellSkeletonStyle = css({
5
- display: 'block',
6
- width: '60%',
7
- maxWidth: '120px',
8
- height: '16px',
9
- margin: '8px',
10
- borderRadius: '6px',
11
- backgroundColor: 'var(--affine-hover-color)',
2
+ // A cell whose value is on its way: a spinner centred in the cell, the
3
+ // height of a drawn one, never a skeleton (recette 3; the host's rule,
4
+ // ADR-0057 on the Labre side).
5
+ export const cellLoadingStyle = css({
6
+ display: 'flex',
7
+ alignItems: 'center',
8
+ justifyContent: 'center',
9
+ width: '100%',
10
+ minHeight: '32px',
11
+ fontSize: '16px',
12
12
  });
13
13
  export const cellEmptyStyle = css({
14
14
  display: 'block',
@@ -2,7 +2,7 @@ import { type TemplateResult } from 'lit';
2
2
  import type { Cell } from '../../view-manager/cell.js';
3
3
  /**
4
4
  * What a cell container draws INSTEAD of its renderer while the cell is not
5
- * `ready` (ADR 0035 §9e): a skeleton while `pending`, an empty cell on
5
+ * `ready` (ADR 0035 §9e): a spinner while `pending`, an empty cell on
6
6
  * `error`. `undefined` when ready, so the container mounts its renderer as in
7
7
  * 0.48. No renderer is mounted otherwise, which is what keeps a cell whose
8
8
  * value never arrived from being edited over.
@@ -1,8 +1,9 @@
1
+ import { LoadingIcon } from '../../../../affine-components/icons/index.js';
1
2
  import { html } from 'lit';
2
- import { cellEmptyStyle, cellSkeletonStyle } from './cell-status-css.js';
3
+ import { cellEmptyStyle, cellLoadingStyle } from './cell-status-css.js';
3
4
  /**
4
5
  * What a cell container draws INSTEAD of its renderer while the cell is not
5
- * `ready` (ADR 0035 §9e): a skeleton while `pending`, an empty cell on
6
+ * `ready` (ADR 0035 §9e): a spinner while `pending`, an empty cell on
6
7
  * `error`. `undefined` when ready, so the container mounts its renderer as in
7
8
  * 0.48. No renderer is mounted otherwise, which is what keeps a cell whose
8
9
  * value never arrived from being edited over.
@@ -13,11 +14,12 @@ export function renderCellStatus(cell) {
13
14
  return undefined;
14
15
  if (status === 'pending') {
15
16
  return html `<span
16
- class="${cellSkeletonStyle}"
17
- data-testid="dv-cell-skeleton"
17
+ class="${cellLoadingStyle}"
18
+ data-testid="dv-cell-loading"
18
19
  data-cell-status="pending"
19
20
  aria-busy="true"
20
- ></span>`;
21
+ >${LoadingIcon()}</span
22
+ >`;
21
23
  }
22
24
  return html `<span class="${cellEmptyStyle}" data-cell-status="error"></span>`;
23
25
  }
@@ -1,22 +1,22 @@
1
1
  import { ArrowLeftBigIcon } from '@blocksuite/icons/lit';
2
2
  import { html } from 'lit';
3
3
  export const menuTitle = (name, onBack) => {
4
- return html `
5
- <div
6
- style="display:flex;align-items:center;gap: 4px;padding: 3px 3px 3px 2px"
7
- >
8
- <div
9
- @click=${onBack}
10
- class="dv-icon-20 dv-hover dv-pd-2 dv-round-4"
11
- style="display:flex;"
12
- >
13
- ${ArrowLeftBigIcon()}
14
- </div>
15
- <div
16
- style="font-weight:500;font-size: 14px;line-height: 22px;color: var(--affine-text-primary-color)"
17
- >
18
- ${name}
19
- </div>
20
- </div>
4
+ return html `
5
+ <div
6
+ style="display:flex;align-items:center;gap: 4px;padding: 3px 3px 3px 2px"
7
+ >
8
+ <div
9
+ @click=${onBack}
10
+ class="dv-icon-20 dv-hover dv-pd-2 dv-round-4"
11
+ style="display:flex;"
12
+ >
13
+ ${ArrowLeftBigIcon()}
14
+ </div>
15
+ <div
16
+ style="font-weight:500;font-size: 14px;line-height: 22px;color: var(--affine-text-primary-color)"
17
+ >
18
+ ${name}
19
+ </div>
20
+ </div>
21
21
  `;
22
22
  };
@@ -4,12 +4,30 @@ export declare class NumberCell extends BaseCellRenderer<number, number, NumberP
4
4
  private accessor _inputEle;
5
5
  private _getFormattedString;
6
6
  private readonly _keydown;
7
+ /**
8
+ * The formatted text the input opened with, bound while editing: a value
9
+ * committed while typing must not reformat the input under the caret
10
+ * (`1,` typed, `1` committed, the comma kept).
11
+ */
12
+ private _opened;
13
+ /** The number the editor opened with, then the last one committed: a
14
+ * commit writes only a change (recette 3, P3-5). */
15
+ private _base;
16
+ private _baseSet;
17
+ private readonly _typing;
18
+ /** Parsed input; `null` for text that is not a number yet. */
19
+ private _parse;
20
+ private _changed;
21
+ /** While typing: a number commits, a half-typed one waits, the input is
22
+ * left as typed. */
23
+ private _commitTyped;
7
24
  private readonly _setValue;
8
25
  focusEnd: () => void;
9
26
  _blur(): void;
10
27
  _focus(): void;
11
28
  afterEnterEditingMode(): void;
12
29
  beforeExitEditingMode(): void;
30
+ disconnectedCallback(): void;
13
31
  render(): import("lit-html").TemplateResult<1>;
14
32
  }
15
33
  export declare const numberPropertyConfig: import("../../index.js").PropertyMetaConfig<"number", {
@@ -39,6 +39,7 @@ import { BaseCellRenderer } from '../../core/property/index.js';
39
39
  import { createFromBaseCellRenderer } from '../../core/property/renderer.js';
40
40
  import { stopPropagation } from '../../core/utils/event.js';
41
41
  import { createIcon } from '../../core/utils/uni-icon.js';
42
+ import { TypingCommit } from '../typing-commit.js';
42
43
  import { numberInputStyle, numberStyle } from './cell-renderer-css.js';
43
44
  import { numberPropertyModelConfig } from './define.js';
44
45
  import { formatNumber, parseNumber, } from './utils/formatter.js';
@@ -63,14 +64,15 @@ let NumberCell = (() => {
63
64
  });
64
65
  }
65
66
  });
67
+ this._baseSet = false;
68
+ this._typing = new TypingCommit(() => this._commitTyped());
66
69
  this._setValue = (str = this._inputEle?.value) => {
67
- if (!str) {
68
- this.valueSetNextTick(undefined);
70
+ this._typing.cancel();
71
+ // No input, nothing typed: never read as a cleared value.
72
+ if (str === undefined)
69
73
  return;
70
- }
71
- const enableNewFormatting = this.view.featureFlags$.value.enable_number_formatting;
72
- const value = enableNewFormatting ? parseNumber(str) : parseFloat(str);
73
- if (isNaN(value)) {
74
+ const value = this._parse(str);
75
+ if (value === null) {
74
76
  if (this._inputEle) {
75
77
  this._inputEle.value = this.value
76
78
  ? this._getFormattedString(this.value)
@@ -78,10 +80,11 @@ let NumberCell = (() => {
78
80
  }
79
81
  return;
80
82
  }
81
- if (this._inputEle) {
83
+ if (this._inputEle && value !== undefined) {
82
84
  this._inputEle.value = this._getFormattedString(value);
83
85
  }
84
- this.valueSetNextTick(value);
86
+ if (this._changed(value))
87
+ this.valueSetNextTick(value);
85
88
  };
86
89
  this.focusEnd = () => {
87
90
  if (!this._inputEle)
@@ -111,6 +114,34 @@ let NumberCell = (() => {
111
114
  : value.toString()
112
115
  : '';
113
116
  }
117
+ /** Parsed input; `null` for text that is not a number yet. */
118
+ _parse(str) {
119
+ if (!str)
120
+ return undefined;
121
+ const enableNewFormatting = this.view.featureFlags$.value.enable_number_formatting;
122
+ const value = enableNewFormatting ? parseNumber(str) : parseFloat(str);
123
+ return isNaN(value) ? null : value;
124
+ }
125
+ _changed(value) {
126
+ const base = this._baseSet ? this._base : this.value;
127
+ if (value === base)
128
+ return false;
129
+ this._base = value;
130
+ this._baseSet = true;
131
+ return true;
132
+ }
133
+ /** While typing: a number commits, a half-typed one waits, the input is
134
+ * left as typed. */
135
+ _commitTyped() {
136
+ this._typing.cancel();
137
+ const input = this._inputEle;
138
+ if (!input)
139
+ return;
140
+ const value = this._parse(input.value);
141
+ if (value === null || !this._changed(value))
142
+ return;
143
+ this.valueSetImmediate(value);
144
+ }
114
145
  _blur() {
115
146
  this.selectCurrentCell(false);
116
147
  }
@@ -125,14 +156,21 @@ let NumberCell = (() => {
125
156
  beforeExitEditingMode() {
126
157
  this._setValue();
127
158
  }
159
+ disconnectedCallback() {
160
+ if (this.isEditing$?.peek())
161
+ this._commitTyped();
162
+ this._typing.cancel();
163
+ super.disconnectedCallback();
164
+ }
128
165
  render() {
129
166
  if (this.isEditing$.value) {
130
- const formatted = this.value ? this._getFormattedString(this.value) : '';
167
+ this._opened ??= this.value ? this._getFormattedString(this.value) : '';
131
168
  return html `<input
132
169
  type="text"
133
170
  autocomplete="off"
134
- .value="${formatted}"
171
+ .value="${this._opened}"
135
172
  @keydown="${this._keydown}"
173
+ @input="${() => this._typing.schedule()}"
136
174
  @blur="${this._blur}"
137
175
  @focus="${this._focus}"
138
176
  class="${numberInputStyle} number"
@@ -140,6 +178,9 @@ let NumberCell = (() => {
140
178
  />`;
141
179
  }
142
180
  else {
181
+ this._opened = undefined;
182
+ this._base = undefined;
183
+ this._baseSet = false;
143
184
  return html ` <div class="${numberStyle} number">
144
185
  ${this._getFormattedString()}
145
186
  </div>`;
@@ -1,11 +1,33 @@
1
1
  import { BaseCellRenderer } from '../../core/property/index.js';
2
+ /**
3
+ * The plain-text cell (a hosted source's text and title columns, the title
4
+ * band's text). What is typed is committed while typing (after a pause),
5
+ * when the input loses the focus, when the cell leaves the DOM and when the
6
+ * cell exits editing (Enter, Escape, Tab, another cell): leaving by a path
7
+ * no view reports, a click outside the editor, lost the edit (recette 3,
8
+ * P3-5, `text-cell-commit.unit.spec.ts`). Escape commits too: what was typed
9
+ * is kept, as in the table before. A commit writes only what changed since
10
+ * the editor opened or last committed, so an exit without typing writes
11
+ * nothing and a value another peer wrote meanwhile is not overwritten.
12
+ */
2
13
  export declare class TextCell extends BaseCellRenderer<string, string> {
3
14
  private accessor _inputEle;
15
+ /**
16
+ * The text the input opened with, bound while editing: a value the
17
+ * source echoes back mid-typing (a commit while typing, a remote write)
18
+ * must not rewrite the input under the caret.
19
+ */
20
+ private _opened;
21
+ /** The last text handed to the source in this edit session. */
22
+ private _sent;
23
+ private readonly _typing;
4
24
  private readonly _keydown;
5
- private readonly _setValue;
25
+ private readonly _onBlur;
26
+ private _commit;
6
27
  focusEnd: () => void;
7
28
  afterEnterEditingMode(): void;
8
29
  beforeExitEditingMode(): void;
30
+ disconnectedCallback(): void;
9
31
  render(): import("lit-html").TemplateResult<1>;
10
32
  }
11
33
  export declare const textPropertyConfig: import("../../index.js").PropertyMetaConfig<"text", {}, string, string>;