@formicoidea/labre-core 0.48.0 → 0.49.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 (222) hide show
  1. package/dist/_pkgs/affine-block-data-view/configs/slash-menu.js +3 -1
  2. package/dist/_pkgs/affine-block-data-view/view.d.ts +17 -1
  3. package/dist/_pkgs/affine-block-data-view/view.js +21 -2
  4. package/dist/_pkgs/affine-block-database/commands.d.ts +2 -2
  5. package/dist/_pkgs/affine-block-database/commands.js +3 -3
  6. package/dist/_pkgs/affine-block-database/components/values-banner.d.ts +28 -0
  7. package/dist/_pkgs/affine-block-database/components/values-banner.js +199 -0
  8. package/dist/_pkgs/affine-block-database/configs/slash-menu.d.ts +6 -1
  9. package/dist/_pkgs/affine-block-database/configs/slash-menu.js +57 -70
  10. package/dist/_pkgs/affine-block-database/data-source.d.ts +9 -5
  11. package/dist/_pkgs/affine-block-database/data-source.js +11 -7
  12. package/dist/_pkgs/affine-block-database/database-block-styles.d.ts +2 -0
  13. package/dist/_pkgs/affine-block-database/database-block-styles.js +15 -0
  14. package/dist/_pkgs/affine-block-database/database-block.d.ts +23 -0
  15. package/dist/_pkgs/affine-block-database/database-block.js +141 -19
  16. package/dist/_pkgs/affine-block-database/effects.js +2 -0
  17. package/dist/_pkgs/affine-block-database/external-data-source.d.ts +69 -2
  18. package/dist/_pkgs/affine-block-database/external-data-source.js +88 -16
  19. package/dist/_pkgs/affine-block-database/index.d.ts +2 -0
  20. package/dist/_pkgs/affine-block-database/index.js +2 -0
  21. package/dist/_pkgs/affine-block-database/linked-view.d.ts +38 -0
  22. package/dist/_pkgs/affine-block-database/linked-view.js +109 -0
  23. package/dist/_pkgs/affine-block-database/properties/index.d.ts +2 -0
  24. package/dist/_pkgs/affine-block-database/properties/index.js +2 -0
  25. package/dist/_pkgs/affine-block-database/properties/text/hosted.d.ts +15 -0
  26. package/dist/_pkgs/affine-block-database/properties/text/hosted.js +24 -0
  27. package/dist/_pkgs/affine-block-database/properties/title/hosted.d.ts +16 -0
  28. package/dist/_pkgs/affine-block-database/properties/title/hosted.js +42 -0
  29. package/dist/_pkgs/affine-block-database/service/index.d.ts +3 -0
  30. package/dist/_pkgs/affine-block-database/service/index.js +3 -0
  31. package/dist/_pkgs/affine-block-database/service/new-row-menu.d.ts +49 -0
  32. package/dist/_pkgs/affine-block-database/service/new-row-menu.js +21 -0
  33. package/dist/_pkgs/affine-block-database/service/open-row.d.ts +77 -0
  34. package/dist/_pkgs/affine-block-database/service/open-row.js +62 -0
  35. package/dist/_pkgs/affine-block-database/service/properties-panel.d.ts +23 -0
  36. package/dist/_pkgs/affine-block-database/service/properties-panel.js +33 -0
  37. package/dist/_pkgs/affine-block-database/translations.d.ts +10 -0
  38. package/dist/_pkgs/affine-block-database/translations.js +35 -0
  39. package/dist/_pkgs/affine-block-database/view-creation.d.ts +10 -0
  40. package/dist/_pkgs/affine-block-database/view-creation.js +14 -0
  41. package/dist/_pkgs/affine-block-database/view.d.ts +31 -1
  42. package/dist/_pkgs/affine-block-database/view.js +44 -5
  43. package/dist/_pkgs/affine-block-database/views/index.d.ts +30 -3
  44. package/dist/_pkgs/affine-block-database/views/index.js +44 -3
  45. package/dist/_pkgs/affine-components/date-picker/date-picker.d.ts +20 -0
  46. package/dist/_pkgs/affine-components/date-picker/date-picker.js +60 -26
  47. package/dist/_pkgs/affine-components/date-picker/style.js +1 -0
  48. package/dist/_pkgs/affine-components/translations.d.ts +4 -0
  49. package/dist/_pkgs/affine-components/translations.js +26 -0
  50. package/dist/_pkgs/affine-fragment-doc-title/doc-title.d.ts +18 -0
  51. package/dist/_pkgs/affine-fragment-doc-title/doc-title.js +41 -2
  52. package/dist/_pkgs/affine-fragment-doc-title/title-band/band-cell.d.ts +8 -0
  53. package/dist/_pkgs/affine-fragment-doc-title/title-band/band-cell.js +12 -0
  54. package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.d.ts +5 -0
  55. package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.js +44 -4
  56. package/dist/_pkgs/affine-model/blocks/database/types.d.ts +16 -0
  57. package/dist/_pkgs/affine-model/blocks/database/types.js +5 -1
  58. package/dist/_pkgs/affine-shared/services/data-source-picker-service.d.ts +139 -0
  59. package/dist/_pkgs/affine-shared/services/data-source-picker-service.js +22 -0
  60. package/dist/_pkgs/affine-shared/services/index.d.ts +1 -0
  61. package/dist/_pkgs/affine-shared/services/index.js +1 -0
  62. package/dist/_pkgs/affine-shared/services/telemetry-service/database.d.ts +59 -0
  63. package/dist/_pkgs/affine-shared/services/title-band-service.d.ts +24 -0
  64. package/dist/_pkgs/data-view/core/component/cell-status/cell-status-css.d.ts +2 -0
  65. package/dist/_pkgs/data-view/core/component/cell-status/cell-status-css.js +16 -0
  66. package/dist/_pkgs/data-view/core/component/cell-status/cell-status.d.ts +10 -0
  67. package/dist/_pkgs/data-view/core/component/cell-status/cell-status.js +23 -0
  68. package/dist/_pkgs/data-view/core/component/index.d.ts +1 -0
  69. package/dist/_pkgs/data-view/core/component/index.js +1 -0
  70. package/dist/_pkgs/data-view/core/component/overflow/fit.d.ts +26 -0
  71. package/dist/_pkgs/data-view/core/component/overflow/fit.js +48 -0
  72. package/dist/_pkgs/data-view/core/component/overflow/overflow.d.ts +26 -3
  73. package/dist/_pkgs/data-view/core/component/overflow/overflow.js +84 -31
  74. package/dist/_pkgs/data-view/core/component/tags/colors.d.ts +7 -0
  75. package/dist/_pkgs/data-view/core/component/tags/colors.js +22 -10
  76. package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.d.ts +18 -0
  77. package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.js +63 -21
  78. package/dist/_pkgs/data-view/core/data-source/base.d.ts +5 -1
  79. package/dist/_pkgs/data-view/core/data-source/base.js +7 -1
  80. package/dist/_pkgs/data-view/core/data-source/hydration.d.ts +44 -0
  81. package/dist/_pkgs/data-view/core/data-source/hydration.js +31 -0
  82. package/dist/_pkgs/data-view/core/data-source/index.d.ts +1 -0
  83. package/dist/_pkgs/data-view/core/data-source/index.js +1 -0
  84. package/dist/_pkgs/data-view/core/data-view.d.ts +22 -2
  85. package/dist/_pkgs/data-view/core/data-view.js +14 -0
  86. package/dist/_pkgs/data-view/core/effect.js +2 -0
  87. package/dist/_pkgs/data-view/core/group-by/collapsed-state.d.ts +3 -0
  88. package/dist/_pkgs/data-view/core/group-by/collapsed-state.js +59 -0
  89. package/dist/_pkgs/data-view/core/group-by/group-properties.d.ts +21 -0
  90. package/dist/_pkgs/data-view/core/group-by/group-properties.js +38 -0
  91. package/dist/_pkgs/data-view/core/group-by/group-title.js +4 -0
  92. package/dist/_pkgs/data-view/core/group-by/group-visibility.d.ts +40 -0
  93. package/dist/_pkgs/data-view/core/group-by/group-visibility.js +291 -0
  94. package/dist/_pkgs/data-view/core/group-by/setting.d.ts +11 -3
  95. package/dist/_pkgs/data-view/core/group-by/setting.js +81 -8
  96. package/dist/_pkgs/data-view/core/group-by/trait.d.ts +22 -0
  97. package/dist/_pkgs/data-view/core/group-by/trait.js +62 -1
  98. package/dist/_pkgs/data-view/core/index.d.ts +3 -0
  99. package/dist/_pkgs/data-view/core/index.js +3 -0
  100. package/dist/_pkgs/data-view/core/property/base-cell.d.ts +15 -1
  101. package/dist/_pkgs/data-view/core/property/base-cell.js +28 -3
  102. package/dist/_pkgs/data-view/core/property/standalone-cell.d.ts +15 -1
  103. package/dist/_pkgs/data-view/core/property/standalone-cell.js +19 -1
  104. package/dist/_pkgs/data-view/core/telemetry.d.ts +16 -0
  105. package/dist/_pkgs/data-view/core/telemetry.js +22 -0
  106. package/dist/_pkgs/data-view/core/utils/new-tab-click.d.ts +2 -0
  107. package/dist/_pkgs/data-view/core/utils/new-tab-click.js +4 -0
  108. package/dist/_pkgs/data-view/core/utils/wording.d.ts +11 -0
  109. package/dist/_pkgs/data-view/core/utils/wording.js +9 -0
  110. package/dist/_pkgs/data-view/core/view/data-view.d.ts +7 -0
  111. package/dist/_pkgs/data-view/core/view/default-name.d.ts +10 -0
  112. package/dist/_pkgs/data-view/core/view/default-name.js +14 -0
  113. package/dist/_pkgs/data-view/core/view/index.d.ts +2 -0
  114. package/dist/_pkgs/data-view/core/view/index.js +2 -0
  115. package/dist/_pkgs/data-view/core/view/open-in.d.ts +27 -0
  116. package/dist/_pkgs/data-view/core/view/open-in.js +39 -0
  117. package/dist/_pkgs/data-view/core/view-manager/cell.d.ts +5 -0
  118. package/dist/_pkgs/data-view/core/view-manager/cell.js +11 -0
  119. package/dist/_pkgs/data-view/core/view-manager/index.d.ts +3 -0
  120. package/dist/_pkgs/data-view/core/view-manager/index.js +3 -0
  121. package/dist/_pkgs/data-view/core/view-manager/new-row-menu-opener.d.ts +18 -0
  122. package/dist/_pkgs/data-view/core/view-manager/new-row-menu-opener.js +2 -0
  123. package/dist/_pkgs/data-view/core/view-manager/properties-panel-opener.d.ts +8 -0
  124. package/dist/_pkgs/data-view/core/view-manager/properties-panel-opener.js +9 -0
  125. package/dist/_pkgs/data-view/core/view-manager/property.d.ts +8 -0
  126. package/dist/_pkgs/data-view/core/view-manager/single-view.d.ts +28 -1
  127. package/dist/_pkgs/data-view/core/view-manager/single-view.js +45 -1
  128. package/dist/_pkgs/data-view/core/view-manager/view-creation.d.ts +49 -0
  129. package/dist/_pkgs/data-view/core/view-manager/view-creation.js +40 -0
  130. package/dist/_pkgs/data-view/core/view-manager/view-manager.d.ts +6 -2
  131. package/dist/_pkgs/data-view/core/view-manager/view-manager.js +2 -2
  132. package/dist/_pkgs/data-view/property-presets/date/cell-renderer.d.ts +2 -0
  133. package/dist/_pkgs/data-view/property-presets/date/cell-renderer.js +11 -2
  134. package/dist/_pkgs/data-view/property-presets/multi-select/cell-renderer.js +2 -0
  135. package/dist/_pkgs/data-view/property-presets/select/cell-renderer.js +2 -0
  136. package/dist/_pkgs/data-view/translations.d.ts +55 -0
  137. package/dist/_pkgs/data-view/translations.js +181 -0
  138. package/dist/_pkgs/data-view/view-presets/calendar/define.js +3 -1
  139. package/dist/_pkgs/data-view/view-presets/convert.js +2 -0
  140. package/dist/_pkgs/data-view/view-presets/effect.js +4 -0
  141. package/dist/_pkgs/data-view/view-presets/flat/flat-converts.d.ts +2 -0
  142. package/dist/_pkgs/data-view/view-presets/flat/flat-converts.js +35 -0
  143. package/dist/_pkgs/data-view/view-presets/flat/flat-view-manager.d.ts +79 -0
  144. package/dist/_pkgs/data-view/view-presets/flat/flat-view-manager.js +194 -0
  145. package/dist/_pkgs/data-view/view-presets/flat/flat-view-ui.d.ts +56 -0
  146. package/dist/_pkgs/data-view/view-presets/flat/flat-view-ui.js +266 -0
  147. package/dist/_pkgs/data-view/view-presets/gallery/define.d.ts +14 -0
  148. package/dist/_pkgs/data-view/view-presets/gallery/define.js +15 -0
  149. package/dist/_pkgs/data-view/view-presets/gallery/effect.d.ts +1 -0
  150. package/dist/_pkgs/data-view/view-presets/gallery/effect.js +4 -0
  151. package/dist/_pkgs/data-view/view-presets/gallery/gallery-view.d.ts +27 -0
  152. package/dist/_pkgs/data-view/view-presets/gallery/gallery-view.js +179 -0
  153. package/dist/_pkgs/data-view/view-presets/gallery/index.d.ts +2 -0
  154. package/dist/_pkgs/data-view/view-presets/gallery/index.js +2 -0
  155. package/dist/_pkgs/data-view/view-presets/gallery/renderer.d.ts +1 -0
  156. package/dist/_pkgs/data-view/view-presets/gallery/renderer.js +11 -0
  157. package/dist/_pkgs/data-view/view-presets/index.d.ts +5 -0
  158. package/dist/_pkgs/data-view/view-presets/index.js +7 -0
  159. package/dist/_pkgs/data-view/view-presets/kanban/define.js +3 -1
  160. package/dist/_pkgs/data-view/view-presets/kanban/kanban-view-manager.js +5 -53
  161. package/dist/_pkgs/data-view/view-presets/kanban/mobile/card.js +8 -1
  162. package/dist/_pkgs/data-view/view-presets/kanban/mobile/cell.js +6 -1
  163. package/dist/_pkgs/data-view/view-presets/kanban/mobile/group.d.ts +4 -2
  164. package/dist/_pkgs/data-view/view-presets/kanban/mobile/group.js +52 -6
  165. package/dist/_pkgs/data-view/view-presets/kanban/mobile/kanban-view-ui-logic.js +5 -1
  166. package/dist/_pkgs/data-view/view-presets/kanban/pc/card.js +2 -0
  167. package/dist/_pkgs/data-view/view-presets/kanban/pc/cell.js +4 -0
  168. package/dist/_pkgs/data-view/view-presets/kanban/pc/group.d.ts +4 -2
  169. package/dist/_pkgs/data-view/view-presets/kanban/pc/group.js +51 -6
  170. package/dist/_pkgs/data-view/view-presets/kanban/pc/kanban-view-ui-logic.js +5 -1
  171. package/dist/_pkgs/data-view/view-presets/list/define.d.ts +14 -0
  172. package/dist/_pkgs/data-view/view-presets/list/define.js +15 -0
  173. package/dist/_pkgs/data-view/view-presets/list/effect.d.ts +1 -0
  174. package/dist/_pkgs/data-view/view-presets/list/effect.js +4 -0
  175. package/dist/_pkgs/data-view/view-presets/list/index.d.ts +2 -0
  176. package/dist/_pkgs/data-view/view-presets/list/index.js +2 -0
  177. package/dist/_pkgs/data-view/view-presets/list/list-view.d.ts +24 -0
  178. package/dist/_pkgs/data-view/view-presets/list/list-view.js +194 -0
  179. package/dist/_pkgs/data-view/view-presets/list/renderer.d.ts +1 -0
  180. package/dist/_pkgs/data-view/view-presets/list/renderer.js +11 -0
  181. package/dist/_pkgs/data-view/view-presets/table/collapsed-state.d.ts +3 -14
  182. package/dist/_pkgs/data-view/view-presets/table/collapsed-state.js +6 -30
  183. package/dist/_pkgs/data-view/view-presets/table/consts.d.ts +2 -0
  184. package/dist/_pkgs/data-view/view-presets/table/consts.js +2 -0
  185. package/dist/_pkgs/data-view/view-presets/table/define.js +3 -1
  186. package/dist/_pkgs/data-view/view-presets/table/mobile/cell.js +4 -1
  187. package/dist/_pkgs/data-view/view-presets/table/mobile/column-header.js +2 -2
  188. package/dist/_pkgs/data-view/view-presets/table/mobile/group.d.ts +3 -1
  189. package/dist/_pkgs/data-view/view-presets/table/mobile/group.js +20 -5
  190. package/dist/_pkgs/data-view/view-presets/table/mobile/row.js +10 -2
  191. package/dist/_pkgs/data-view/view-presets/table/mobile/table-view-ui-logic.js +4 -1
  192. package/dist/_pkgs/data-view/view-presets/table/pc/cell.js +4 -1
  193. package/dist/_pkgs/data-view/view-presets/table/pc/controller/hotkeys.js +1 -1
  194. package/dist/_pkgs/data-view/view-presets/table/pc/group.d.ts +3 -1
  195. package/dist/_pkgs/data-view/view-presets/table/pc/group.js +20 -5
  196. package/dist/_pkgs/data-view/view-presets/table/pc/menu.d.ts +1 -1
  197. package/dist/_pkgs/data-view/view-presets/table/pc/menu.js +2 -1
  198. package/dist/_pkgs/data-view/view-presets/table/pc/row/row.js +3 -2
  199. package/dist/_pkgs/data-view/view-presets/table/pc/table-view-ui-logic.js +4 -1
  200. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/hotkeys.js +1 -1
  201. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/bottom/stats/column-stats-column.js +5 -1
  202. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/group-title.js +22 -19
  203. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/row/cell.js +4 -1
  204. package/dist/_pkgs/data-view/view-presets/table/pc-virtual/table-view-ui-logic.js +7 -2
  205. package/dist/_pkgs/data-view/view-presets/table/stats/column-stats-column.js +5 -1
  206. package/dist/_pkgs/data-view/view-presets/table/table-view-manager.js +5 -53
  207. package/dist/_pkgs/data-view/widget-presets/tools/presets/table-add-row/add-row.d.ts +1 -0
  208. package/dist/_pkgs/data-view/widget-presets/tools/presets/table-add-row/add-row.js +60 -2
  209. package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-options.d.ts +18 -1
  210. package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-options.js +121 -124
  211. package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.d.ts +43 -0
  212. package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.js +187 -0
  213. package/dist/_pkgs/data-view/widget-presets/views-bar/views-view.d.ts +36 -3
  214. package/dist/_pkgs/data-view/widget-presets/views-bar/views-view.js +187 -59
  215. package/dist/extensions/view.d.ts +2 -2
  216. package/dist/extensions/view.js +10 -3
  217. package/dist/flags.d.ts +8 -4
  218. package/dist/flags.js +8 -4
  219. package/dist/frameworks.d.ts +27 -0
  220. package/dist/frameworks.js +28 -0
  221. package/dist/translations.js +13 -1
  222. package/package.json +5 -1
@@ -102,7 +102,7 @@ const styles = css `
102
102
  right: 8px;
103
103
  top: 8px;
104
104
  display: flex;
105
- gap: 4px;
105
+ gap: 20px;
106
106
  }
107
107
 
108
108
  .mobile-card-op {
@@ -115,6 +115,13 @@ const styles = css `
115
115
  font-size: 16px;
116
116
  color: ${unsafeCSSVarV2('icon/primary')};
117
117
  }
118
+
119
+ /* A 44px touch target around the drawn 24px op (B5, ADR 0035 §1). */
120
+ .mobile-card-op::after {
121
+ content: '';
122
+ position: absolute;
123
+ inset: -10px;
124
+ }
118
125
  `;
119
126
  let MobileKanbanCard = (() => {
120
127
  let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
@@ -40,6 +40,7 @@ import { computed, effect, signal } from '@preact/signals-core';
40
40
  import { css } from 'lit';
41
41
  import { property } from 'lit/decorators.js';
42
42
  import { html } from 'lit/static-html.js';
43
+ import { renderCellStatus } from '../../../core/component/cell-status/cell-status.js';
43
44
  import { renderUniLit } from '../../../core/utils/uni-component/uni-component.js';
44
45
  const styles = css `
45
46
  mobile-kanban-cell {
@@ -47,7 +48,8 @@ const styles = css `
47
48
  display: flex;
48
49
  align-items: center;
49
50
  padding: 4px;
50
- min-height: 20px;
51
+ /* A finger's target (B5, ADR 0035 §1); was 20px when mobile was read-only. */
52
+ min-height: 44px;
51
53
  border: 1px solid transparent;
52
54
  box-sizing: border-box;
53
55
  }
@@ -139,6 +141,9 @@ let MobileKanbanCell = (() => {
139
141
  if (!renderer)
140
142
  return;
141
143
  const { view } = renderer;
144
+ const status = renderCellStatus(props.cell);
145
+ if (status)
146
+ return html ` ${this.renderIcon()} ${status}`;
142
147
  this.view.lockRows(this.isEditing$.value);
143
148
  this.dataset['editing'] = `${this.isEditing$.value}`;
144
149
  return html ` ${this.renderIcon()}
@@ -1,9 +1,11 @@
1
- import { ShadowlessElement } from '../../../../std/index.js';
1
+ import { type BlockStdScope, ShadowlessElement } from '../../../../std/index.js';
2
2
  import type { Group } from '../../../core/group-by/trait.js';
3
3
  import type { MobileKanbanViewUILogic } from './kanban-view-ui-logic.js';
4
4
  declare const MobileKanbanGroup_base: typeof ShadowlessElement & import("../../../../global/utils/types.js").Constructor<import("../../../../global/lit/with-disposable.js").DisposableClass>;
5
5
  export declare class MobileKanbanGroup extends MobileKanbanGroup_base {
6
- static styles: import("lit").CSSResult;
6
+ static styles: import("lit").CSSResult[];
7
+ /** Absent outside an editor host: the wordings read English. */
8
+ accessor std: BlockStdScope;
7
9
  private readonly clickAddCard;
8
10
  private readonly clickAddCardInStart;
9
11
  private readonly clickGroupOptions;
@@ -35,13 +35,16 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
35
35
  import { menu, popFilterableSimpleMenu, popupTargetFromElement, } from '../../../../affine-components/context-menu/index.js';
36
36
  import { SignalWatcher, WithDisposable } from '../../../../global/lit/index.js';
37
37
  import { AddCursorIcon } from '@blocksuite/icons/lit';
38
- import { ShadowlessElement } from '../../../../std/index.js';
38
+ import { ShadowlessElement, stdContext } from '../../../../std/index.js';
39
+ import { consume } from '@lit/context';
39
40
  import { css, nothing } from 'lit';
40
41
  import { property } from 'lit/decorators.js';
41
42
  import { repeat } from 'lit/directives/repeat.js';
42
43
  import { html } from 'lit/static-html.js';
43
44
  import { GroupTitle } from '../../../core/group-by/group-title.js';
45
+ import { groupToggleStyles, hideGroupAction, renderGroupToggle, } from '../../../core/group-by/group-visibility.js';
44
46
  import { dragHandler } from '../../../core/utils/wc-dnd/dnd-context.js';
47
+ import { wordingOf } from '../../../core/utils/wording.js';
45
48
  const styles = css `
46
49
  mobile-kanban-group {
47
50
  width: 260px;
@@ -69,9 +72,36 @@ const styles = css `
69
72
  gap: 12px;
70
73
  }
71
74
 
75
+ .mobile-group-body[hidden] {
76
+ display: none;
77
+ }
78
+
79
+ @media (pointer: coarse) {
80
+ .mobile-group-header {
81
+ height: auto;
82
+ min-height: 44px;
83
+ }
84
+ }
85
+
86
+ .mobile-group-header-main {
87
+ flex: 1 1 auto;
88
+ min-width: 0;
89
+ display: flex;
90
+ align-items: center;
91
+ justify-content: space-between;
92
+ gap: 8px;
93
+ overflow: hidden;
94
+ }
95
+
96
+ .dv-kanban-hidden-groups {
97
+ width: 260px;
98
+ flex-shrink: 0;
99
+ }
100
+
72
101
  .mobile-add-card {
73
102
  display: flex;
74
103
  align-items: center;
104
+ min-height: 44px;
75
105
  padding: 4px;
76
106
  border-radius: 4px;
77
107
  font-size: var(--data-view-cell-text-size);
@@ -81,6 +111,9 @@ const styles = css `
81
111
  `;
82
112
  let MobileKanbanGroup = (() => {
83
113
  let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
114
+ let _std_decorators;
115
+ let _std_initializers = [];
116
+ let _std_extraInitializers = [];
84
117
  let _group_decorators;
85
118
  let _group_initializers = [];
86
119
  let _group_extraInitializers = [];
@@ -90,24 +123,35 @@ let MobileKanbanGroup = (() => {
90
123
  return class MobileKanbanGroup extends _classSuper {
91
124
  static {
92
125
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
126
+ _std_decorators = [consume({ context: stdContext })];
93
127
  _group_decorators = [property({ attribute: false })];
94
128
  _kanbanViewLogic_decorators = [property({ attribute: false })];
129
+ __esDecorate(this, null, _std_decorators, { kind: "accessor", name: "std", static: false, private: false, access: { has: obj => "std" in obj, get: obj => obj.std, set: (obj, value) => { obj.std = value; } }, metadata: _metadata }, _std_initializers, _std_extraInitializers);
95
130
  __esDecorate(this, null, _group_decorators, { kind: "accessor", name: "group", static: false, private: false, access: { has: obj => "group" in obj, get: obj => obj.group, set: (obj, value) => { obj.group = value; } }, metadata: _metadata }, _group_initializers, _group_extraInitializers);
96
131
  __esDecorate(this, null, _kanbanViewLogic_decorators, { kind: "accessor", name: "kanbanViewLogic", static: false, private: false, access: { has: obj => "kanbanViewLogic" in obj, get: obj => obj.kanbanViewLogic, set: (obj, value) => { obj.kanbanViewLogic = value; } }, metadata: _metadata }, _kanbanViewLogic_initializers, _kanbanViewLogic_extraInitializers);
97
132
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
98
133
  }
99
- static { this.styles = styles; }
134
+ static { this.styles = [styles, groupToggleStyles]; }
135
+ #std_accessor_storage;
136
+ /** Absent outside an editor host: the wordings read English. */
137
+ get std() { return this.#std_accessor_storage; }
138
+ set std(value) { this.#std_accessor_storage = value; }
100
139
  render() {
101
140
  const cards = this.group.rows;
141
+ // Folded (personal, B8): the header and its count stay, the cards go.
142
+ const collapsed = this.group.manager.collapsed$(this.group.key).value;
102
143
  return html `
103
144
  <div class="mobile-group-header" ${dragHandler(this.group.key)}>
104
- ${GroupTitle(this.group, {
145
+ ${renderGroupToggle(this.group, wordingOf(this.std))}
146
+ <div class="mobile-group-header-main">
147
+ ${GroupTitle(this.group, {
105
148
  readonly: this.view.readonly$.value,
106
149
  clickAdd: this.clickAddCardInStart,
107
150
  clickOps: this.clickGroupOptions,
108
151
  })}
152
+ </div>
109
153
  </div>
110
- <div class="mobile-group-body">
154
+ <div class="mobile-group-body" ?hidden="${collapsed}">
111
155
  ${repeat(cards, row => row.rowId, row => {
112
156
  return html `
113
157
  <mobile-kanban-card
@@ -142,10 +186,11 @@ let MobileKanbanGroup = (() => {
142
186
  }
143
187
  constructor() {
144
188
  super(...arguments);
145
- this.clickAddCard = () => {
189
+ this.#std_accessor_storage = __runInitializers(this, _std_initializers, void 0);
190
+ this.clickAddCard = (__runInitializers(this, _std_extraInitializers), () => {
146
191
  this.view.addCard('end', this.group.key);
147
192
  this.requestUpdate();
148
- };
193
+ });
149
194
  this.clickAddCardInStart = () => {
150
195
  this.view.addCard('start', this.group.key);
151
196
  this.requestUpdate();
@@ -165,6 +210,7 @@ let MobileKanbanGroup = (() => {
165
210
  this.requestUpdate();
166
211
  },
167
212
  }),
213
+ hideGroupAction(this.group, wordingOf(this.std)),
168
214
  menu.action({
169
215
  name: 'Delete Cards',
170
216
  select: () => {
@@ -97,7 +97,7 @@ export class MobileKanbanViewUI extends DataViewUIBase {
97
97
  this.classList.add(mobileKanbanViewWrapper);
98
98
  }
99
99
  render() {
100
- const groups = this.logic.groupManager.groupsDataList$.value;
100
+ const groups = this.logic.groupManager.visibleGroups$.value;
101
101
  if (!groups) {
102
102
  return html ``;
103
103
  }
@@ -122,6 +122,10 @@ export class MobileKanbanViewUI extends DataViewUIBase {
122
122
  ></mobile-kanban-group>`;
123
123
  })}
124
124
  ${this.logic.renderAddGroup()}
125
+ <dv-hidden-groups
126
+ class="dv-kanban-hidden-groups"
127
+ .groupTrait="${this.logic.groupManager}"
128
+ ></dv-hidden-groups>
125
129
  </div>
126
130
  `;
127
131
  }
@@ -43,6 +43,7 @@ import { property } from 'lit/decorators.js';
43
43
  import { classMap } from 'lit/directives/class-map.js';
44
44
  import { repeat } from 'lit/directives/repeat.js';
45
45
  import { html } from 'lit/static-html.js';
46
+ import { isNewTabClick } from '../../../core/utils/new-tab-click.js';
46
47
  import { openDetail, popCardMenu } from './menu.js';
47
48
  const styles = css `
48
49
  affine-data-view-kanban-card {
@@ -272,6 +273,7 @@ let KanbanCard = (() => {
272
273
  this.kanbanViewLogic.root.openDetailPanel({
273
274
  view: this.view,
274
275
  rowId: this.cardId,
276
+ newTab: isNewTabClick(e),
275
277
  onClose: () => {
276
278
  if (selection) {
277
279
  selection.selection = preSelection;
@@ -39,6 +39,7 @@ import { signal } from '@preact/signals-core';
39
39
  import { css } from 'lit';
40
40
  import { property } from 'lit/decorators.js';
41
41
  import { html } from 'lit/static-html.js';
42
+ import { renderCellStatus } from '../../../core/component/cell-status/cell-status.js';
42
43
  import { renderUniLit } from '../../../core/utils/uni-component/uni-component.js';
43
44
  const styles = css `
44
45
  affine-data-view-kanban-cell {
@@ -150,6 +151,9 @@ let KanbanCell = (() => {
150
151
  if (!renderer)
151
152
  return;
152
153
  const { view } = renderer;
154
+ const status = renderCellStatus(props.cell);
155
+ if (status)
156
+ return html ` ${this.renderIcon()} ${status}`;
153
157
  this.view.lockRows(this.isEditing$.value);
154
158
  this.dataset['editing'] = `${this.isEditing$.value}`;
155
159
  this.style.border = this.isFocus$.value
@@ -1,9 +1,11 @@
1
- import { ShadowlessElement } from '../../../../std/index.js';
1
+ import { type BlockStdScope, ShadowlessElement } from '../../../../std/index.js';
2
2
  import type { Group } from '../../../core/group-by/trait.js';
3
3
  import type { KanbanViewUILogic } from './kanban-view-ui-logic.js';
4
4
  declare const KanbanGroup_base: typeof ShadowlessElement & import("../../../../global/utils/types.js").Constructor<import("../../../../global/lit/with-disposable.js").DisposableClass>;
5
5
  export declare class KanbanGroup extends KanbanGroup_base {
6
- static styles: import("lit").CSSResult;
6
+ static styles: import("lit").CSSResult[];
7
+ /** Absent outside an editor host: the wordings read English. */
8
+ accessor std: BlockStdScope;
7
9
  private readonly clickAddCard;
8
10
  private readonly clickAddCardInStart;
9
11
  private readonly clickGroupOptions;
@@ -35,13 +35,16 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
35
35
  import { menu, popFilterableSimpleMenu, popupTargetFromElement, } from '../../../../affine-components/context-menu/index.js';
36
36
  import { SignalWatcher, WithDisposable } from '../../../../global/lit/index.js';
37
37
  import { AddCursorIcon } from '@blocksuite/icons/lit';
38
- import { ShadowlessElement } from '../../../../std/index.js';
38
+ import { ShadowlessElement, stdContext } from '../../../../std/index.js';
39
+ import { consume } from '@lit/context';
39
40
  import { css, nothing } from 'lit';
40
41
  import { property } from 'lit/decorators.js';
41
42
  import { repeat } from 'lit/directives/repeat.js';
42
43
  import { html } from 'lit/static-html.js';
43
44
  import { GroupTitle } from '../../../core/group-by/group-title.js';
45
+ import { groupToggleStyles, hideGroupAction, renderGroupToggle, } from '../../../core/group-by/group-visibility.js';
44
46
  import { dragHandler } from '../../../core/utils/wc-dnd/dnd-context.js';
47
+ import { wordingOf } from '../../../core/utils/wording.js';
45
48
  const styles = css `
46
49
  affine-data-view-kanban-group {
47
50
  width: 260px;
@@ -114,9 +117,38 @@ const styles = css `
114
117
  .sortable-drag {
115
118
  background-color: var(--affine-background-primary-color);
116
119
  }
120
+
121
+ .group-body[hidden] {
122
+ display: none;
123
+ }
124
+
125
+ @media (pointer: coarse) {
126
+ .group-header {
127
+ height: auto;
128
+ min-height: 44px;
129
+ }
130
+ }
131
+
132
+ .group-header-main {
133
+ flex: 1 1 auto;
134
+ min-width: 0;
135
+ display: flex;
136
+ align-items: center;
137
+ justify-content: space-between;
138
+ gap: 8px;
139
+ overflow: hidden;
140
+ }
141
+
142
+ .dv-kanban-hidden-groups {
143
+ width: 260px;
144
+ flex-shrink: 0;
145
+ }
117
146
  `;
118
147
  let KanbanGroup = (() => {
119
148
  let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
149
+ let _std_decorators;
150
+ let _std_initializers = [];
151
+ let _std_extraInitializers = [];
120
152
  let _group_decorators;
121
153
  let _group_initializers = [];
122
154
  let _group_extraInitializers = [];
@@ -126,24 +158,35 @@ let KanbanGroup = (() => {
126
158
  return class KanbanGroup extends _classSuper {
127
159
  static {
128
160
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
161
+ _std_decorators = [consume({ context: stdContext })];
129
162
  _group_decorators = [property({ attribute: false })];
130
163
  _kanbanViewLogic_decorators = [property({ attribute: false })];
164
+ __esDecorate(this, null, _std_decorators, { kind: "accessor", name: "std", static: false, private: false, access: { has: obj => "std" in obj, get: obj => obj.std, set: (obj, value) => { obj.std = value; } }, metadata: _metadata }, _std_initializers, _std_extraInitializers);
131
165
  __esDecorate(this, null, _group_decorators, { kind: "accessor", name: "group", static: false, private: false, access: { has: obj => "group" in obj, get: obj => obj.group, set: (obj, value) => { obj.group = value; } }, metadata: _metadata }, _group_initializers, _group_extraInitializers);
132
166
  __esDecorate(this, null, _kanbanViewLogic_decorators, { kind: "accessor", name: "kanbanViewLogic", static: false, private: false, access: { has: obj => "kanbanViewLogic" in obj, get: obj => obj.kanbanViewLogic, set: (obj, value) => { obj.kanbanViewLogic = value; } }, metadata: _metadata }, _kanbanViewLogic_initializers, _kanbanViewLogic_extraInitializers);
133
167
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
134
168
  }
135
- static { this.styles = styles; }
169
+ static { this.styles = [styles, groupToggleStyles]; }
170
+ #std_accessor_storage;
171
+ /** Absent outside an editor host: the wordings read English. */
172
+ get std() { return this.#std_accessor_storage; }
173
+ set std(value) { this.#std_accessor_storage = value; }
136
174
  render() {
137
175
  const cards = this.group.rows;
176
+ // Folded (personal, B8): the header and its count stay, the cards go.
177
+ const collapsed = this.group.manager.collapsed$(this.group.key).value;
138
178
  return html `
139
179
  <div class="group-header" ${dragHandler(this.group.key)}>
140
- ${GroupTitle(this.group, {
180
+ ${renderGroupToggle(this.group, wordingOf(this.std))}
181
+ <div class="group-header-main">
182
+ ${GroupTitle(this.group, {
141
183
  readonly: this.view.readonly$.value,
142
184
  clickAdd: this.clickAddCardInStart,
143
185
  clickOps: this.clickGroupOptions,
144
186
  })}
187
+ </div>
145
188
  </div>
146
- <div class="group-body">
189
+ <div class="group-body" ?hidden="${collapsed}">
147
190
  ${repeat(cards, row => row.rowId, row => {
148
191
  return html `
149
192
  <affine-data-view-kanban-card
@@ -178,7 +221,8 @@ let KanbanGroup = (() => {
178
221
  }
179
222
  constructor() {
180
223
  super(...arguments);
181
- this.clickAddCard = () => {
224
+ this.#std_accessor_storage = __runInitializers(this, _std_initializers, void 0);
225
+ this.clickAddCard = (__runInitializers(this, _std_extraInitializers), () => {
182
226
  const id = this.view.addCard('end', this.group.key);
183
227
  requestAnimationFrame(() => {
184
228
  const columnId = this.view.mainProperties$.value.titleColumn ||
@@ -194,7 +238,7 @@ let KanbanGroup = (() => {
194
238
  };
195
239
  });
196
240
  this.requestUpdate();
197
- };
241
+ });
198
242
  this.clickAddCardInStart = () => {
199
243
  const id = this.view.addCard('start', this.group.key);
200
244
  requestAnimationFrame(() => {
@@ -225,6 +269,7 @@ let KanbanGroup = (() => {
225
269
  this.requestUpdate();
226
270
  },
227
271
  }),
272
+ hideGroupAction(this.group, wordingOf(this.std)),
228
273
  menu.action({
229
274
  name: 'Delete Cards',
230
275
  select: () => {
@@ -29,7 +29,7 @@ export class KanbanViewUILogic extends DataViewUILogicBase {
29
29
  });
30
30
  this.groups$ = computed(() => {
31
31
  const groupTrait = this.groupTrait$.value;
32
- return groupTrait?.groupsDataList$.value || [];
32
+ return groupTrait?.visibleGroups$.value || [];
33
33
  });
34
34
  this.clearSelection = () => {
35
35
  this.selectionController.clear();
@@ -204,6 +204,10 @@ export class KanbanViewUI extends DataViewUIBase {
204
204
  >
205
205
  ${this.renderGroups()}
206
206
  ${groupTrait ? this.logic.renderAddGroup(groupTrait) : ''}
207
+ <dv-hidden-groups
208
+ class="dv-kanban-hidden-groups"
209
+ .groupTrait="${groupTrait}"
210
+ ></dv-hidden-groups>
207
211
  </div>
208
212
  `;
209
213
  }
@@ -0,0 +1,14 @@
1
+ import { FlatSingleView, type FlatViewDataType } from '../flat/flat-view-manager.js';
2
+ export declare const listViewType: {
3
+ type: "list";
4
+ createModel: <Data extends import("../../index.js").DataViewDataType>(model: import("../../index.js").DataViewModelConfig<Data>) => import("../../index.js").DataViewModel<"list", Data> & {
5
+ createMeta: (renderer: import("../../index.js").DataViewRendererConfig) => import("../../index.js").ViewMeta<"list", Data>;
6
+ };
7
+ };
8
+ export type ListViewData = FlatViewDataType<typeof listViewType.type>;
9
+ export declare class ListSingleView extends FlatSingleView<ListViewData> {
10
+ get type(): string;
11
+ }
12
+ export declare const listViewModel: import("../../index.js").DataViewModel<"list", ListViewData> & {
13
+ createMeta: (renderer: import("../../index.js").DataViewRendererConfig) => import("../../index.js").ViewMeta<"list", ListViewData>;
14
+ };
@@ -0,0 +1,15 @@
1
+ import { viewType } from '../../core/view/data-view.js';
2
+ import { VIEW_NAME_LIST } from '../../translations.js';
3
+ import { FlatSingleView, flatViewDefaultData, } from '../flat/flat-view-manager.js';
4
+ export const listViewType = viewType('list');
5
+ export class ListSingleView extends FlatSingleView {
6
+ get type() {
7
+ return this.data$.value?.mode ?? listViewType.type;
8
+ }
9
+ }
10
+ export const listViewModel = listViewType.createModel({
11
+ defaultName: VIEW_NAME_LIST[1],
12
+ defaultNameKey: VIEW_NAME_LIST[0],
13
+ dataViewManager: ListSingleView,
14
+ defaultData: flatViewDefaultData,
15
+ });
@@ -0,0 +1 @@
1
+ export declare function listEffects(): void;
@@ -0,0 +1,4 @@
1
+ import { ListViewUI } from './list-view.js';
2
+ export function listEffects() {
3
+ customElements.define('dv-list-view-ui', ListViewUI);
4
+ }
@@ -0,0 +1,2 @@
1
+ export * from './define.js';
2
+ export * from './renderer.js';
@@ -0,0 +1,2 @@
1
+ export * from './define.js';
2
+ export * from './renderer.js';
@@ -0,0 +1,24 @@
1
+ import { FlatViewUI, FlatViewUILogic } from '../flat/flat-view-ui.js';
2
+ import type { ListSingleView } from './define.js';
3
+ /**
4
+ * The list preset (ADR 0035 §1, B7): one line per row, the title on the left
5
+ * and the visible properties on the right, each drawn by the cell a table
6
+ * draws, so a select is the table's tag and opens the table's tag menu. An
7
+ * empty value draws no chip, as in Notion's list: it is set from the opened
8
+ * row. Narrow screens wrap the chips under the title.
9
+ */
10
+ export declare class ListViewUILogic extends FlatViewUILogic<ListSingleView> {
11
+ renderer: import("../../../affine-shared/types/uni-component.js").UniComponent<unknown, {}>;
12
+ }
13
+ export declare class ListViewUI extends FlatViewUI<ListViewUILogic> {
14
+ static styles: import("lit").CSSResult[];
15
+ connectedCallback(): void;
16
+ private renderRow;
17
+ private renderNewRow;
18
+ render(): import("lit-html").TemplateResult<1>;
19
+ }
20
+ declare global {
21
+ interface HTMLElementTagNameMap {
22
+ 'dv-list-view-ui': ListViewUI;
23
+ }
24
+ }