@formicoidea/labre-core 0.52.0 → 0.54.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 (96) hide show
  1. package/dist/_pkgs/affine-block-data-view/data-view-block.js +1 -1
  2. package/dist/_pkgs/affine-block-database/components/title/index.js +7 -2
  3. package/dist/_pkgs/affine-block-database/database-block-styles.js +9 -1
  4. package/dist/_pkgs/affine-block-embed-doc/page-drop/page-drop.d.ts +70 -0
  5. package/dist/_pkgs/affine-block-embed-doc/page-drop/page-drop.js +196 -0
  6. package/dist/_pkgs/affine-block-embed-doc/view.js +3 -0
  7. package/dist/_pkgs/affine-block-frame/frame-template.d.ts +11 -0
  8. package/dist/_pkgs/affine-block-frame/frame-template.js +24 -4
  9. package/dist/_pkgs/affine-block-frame/translations.d.ts +3 -0
  10. package/dist/_pkgs/affine-block-frame/translations.js +7 -0
  11. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +9 -3
  12. package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +9 -5
  13. package/dist/_pkgs/affine-block-surface/index.d.ts +1 -0
  14. package/dist/_pkgs/affine-block-surface/index.js +1 -0
  15. package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.d.ts +55 -3
  16. package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +139 -6
  17. package/dist/_pkgs/affine-block-surface/renderer/notation-tint.d.ts +92 -0
  18. package/dist/_pkgs/affine-block-surface/renderer/notation-tint.js +113 -0
  19. package/dist/_pkgs/affine-block-surface/surface-block.js +2 -2
  20. package/dist/_pkgs/affine-components/color-picker/styles.js +1 -1
  21. package/dist/_pkgs/affine-components/context-menu/input.js +2 -1
  22. package/dist/_pkgs/affine-components/context-menu/menu-renderer.d.ts +7 -0
  23. package/dist/_pkgs/affine-components/context-menu/menu-renderer.js +53 -13
  24. package/dist/_pkgs/affine-components/drop-indicator/file-drop-manager.js +15 -0
  25. package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/index.js +4 -2
  26. package/dist/_pkgs/affine-inline-link/link-node/link-popup/styles.js +1 -1
  27. package/dist/_pkgs/affine-inline-reference/reference-node/reference-popup/reference-popup.js +9 -9
  28. package/dist/_pkgs/affine-shared/consts/notation.d.ts +1 -0
  29. package/dist/_pkgs/affine-shared/consts/notation.js +29 -0
  30. package/dist/_pkgs/affine-shared/services/frame-template-service.d.ts +5 -0
  31. package/dist/_pkgs/affine-shared/services/index.d.ts +1 -0
  32. package/dist/_pkgs/affine-shared/services/index.js +1 -0
  33. package/dist/_pkgs/affine-shared/services/page-drop-service.d.ts +61 -0
  34. package/dist/_pkgs/affine-shared/services/page-drop-service.js +30 -0
  35. package/dist/_pkgs/affine-shared/services/thread-marks-service.d.ts +32 -1
  36. package/dist/_pkgs/affine-shared/styles/scrollbar-style.js +1 -1
  37. package/dist/_pkgs/affine-widget-edgeless-auto-connect/index.js +5 -5
  38. package/dist/_pkgs/affine-widget-edgeless-selected-rect/edgeless-auto-complete.js +2 -2
  39. package/dist/_pkgs/affine-widget-keyboard-toolbar/config.js +6 -6
  40. package/dist/_pkgs/affine-widget-keyboard-toolbar/styles.js +1 -1
  41. package/dist/_pkgs/affine-widget-linked-doc/config.d.ts +8 -0
  42. package/dist/_pkgs/affine-widget-linked-doc/config.js +8 -1
  43. package/dist/_pkgs/affine-widget-linked-doc/linked-doc-popover.js +40 -32
  44. package/dist/_pkgs/affine-widget-linked-doc/styles.js +1 -1
  45. package/dist/_pkgs/affine-widget-linked-doc/translations.d.ts +2 -0
  46. package/dist/_pkgs/affine-widget-linked-doc/translations.js +6 -0
  47. package/dist/_pkgs/affine-widget-thread-marks/excerpt.d.ts +6 -2
  48. package/dist/_pkgs/affine-widget-thread-marks/excerpt.js +8 -0
  49. package/dist/_pkgs/affine-widget-thread-marks/index.d.ts +1 -0
  50. package/dist/_pkgs/affine-widget-thread-marks/index.js +1 -0
  51. package/dist/_pkgs/affine-widget-thread-marks/text-range.d.ts +26 -0
  52. package/dist/_pkgs/affine-widget-thread-marks/text-range.js +59 -0
  53. package/dist/_pkgs/affine-widget-thread-marks/toolbar.d.ts +4 -3
  54. package/dist/_pkgs/affine-widget-thread-marks/toolbar.js +24 -8
  55. package/dist/_pkgs/affine-widget-thread-marks/widget.d.ts +33 -2
  56. package/dist/_pkgs/affine-widget-thread-marks/widget.js +121 -5
  57. package/dist/_pkgs/affine-widget-toolbar/utils.d.ts +2 -1
  58. package/dist/_pkgs/affine-widget-toolbar/utils.js +5 -2
  59. package/dist/_pkgs/data-view/core/common/properties.js +2 -2
  60. package/dist/_pkgs/data-view/core/common/property-menu.d.ts +3 -3
  61. package/dist/_pkgs/data-view/core/common/property-menu.js +7 -7
  62. package/dist/_pkgs/data-view/core/component/overflow/overflow.js +4 -1
  63. package/dist/_pkgs/data-view/core/group-by/renderer/base.d.ts +4 -1
  64. package/dist/_pkgs/data-view/core/group-by/renderer/base.js +17 -2
  65. package/dist/_pkgs/data-view/core/group-by/renderer/number-group.js +1 -1
  66. package/dist/_pkgs/data-view/core/group-by/renderer/select-group.d.ts +0 -3
  67. package/dist/_pkgs/data-view/core/group-by/renderer/select-group.js +63 -118
  68. package/dist/_pkgs/data-view/core/group-by/renderer/string-group.js +1 -1
  69. package/dist/_pkgs/data-view/core/group-by/setting.js +2 -2
  70. package/dist/_pkgs/data-view/core/utils/wording.d.ts +6 -2
  71. package/dist/_pkgs/data-view/core/utils/wording.js +5 -3
  72. package/dist/_pkgs/data-view/core/view/default-name.d.ts +6 -0
  73. package/dist/_pkgs/data-view/core/view/default-name.js +8 -0
  74. package/dist/_pkgs/data-view/translations.d.ts +47 -0
  75. package/dist/_pkgs/data-view/translations.js +124 -0
  76. package/dist/_pkgs/data-view/view-presets/table/mobile/column-header.d.ts +3 -1
  77. package/dist/_pkgs/data-view/view-presets/table/mobile/column-header.js +102 -124
  78. package/dist/_pkgs/data-view/view-presets/table/mobile/group.js +4 -2
  79. package/dist/_pkgs/data-view/view-presets/table/mobile/header.js +17 -9
  80. package/dist/_pkgs/data-view/view-presets/table/mobile/row.js +20 -11
  81. package/dist/_pkgs/data-view/view-presets/table/mobile/table-view-style.d.ts +17 -0
  82. package/dist/_pkgs/data-view/view-presets/table/mobile/table-view-style.js +31 -6
  83. package/dist/_pkgs/data-view/view-presets/table/mobile/table-view-ui-logic.js +2 -2
  84. package/dist/_pkgs/data-view/view-presets/table/pc/group.js +4 -2
  85. package/dist/_pkgs/data-view/widget-presets/quick-setting-bar/filter/list-view.d.ts +3 -1
  86. package/dist/_pkgs/data-view/widget-presets/quick-setting-bar/filter/list-view.js +23 -3
  87. package/dist/_pkgs/data-view/widget-presets/tools/presets/search/search.d.ts +3 -0
  88. package/dist/_pkgs/data-view/widget-presets/tools/presets/search/search.js +37 -5
  89. package/dist/_pkgs/data-view/widget-presets/tools/presets/table-add-row/add-row.d.ts +3 -0
  90. package/dist/_pkgs/data-view/widget-presets/tools/presets/table-add-row/add-row.js +99 -35
  91. package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-options.js +30 -22
  92. package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.js +8 -6
  93. package/dist/_pkgs/data-view/widget-presets/views-bar/views-view.js +15 -0
  94. package/dist/host-panels.d.ts +1 -1
  95. package/dist/host-panels.js +2 -1
  96. package/package.json +1 -1
@@ -35,17 +35,23 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
35
35
  import { menu, popMenu, popupTargetFromElement, } from '../../../../affine-components/context-menu/index.js';
36
36
  import { unsafeCSSVarV2 } from '../../../../affine-shared/theme/index.js';
37
37
  import { SignalWatcher, WithDisposable } from '../../../../global/lit/index.js';
38
- import { DeleteIcon, DuplicateIcon, InsertLeftIcon, InsertRightIcon, MoveLeftIcon, MoveRightIcon, ViewIcon, } from '@blocksuite/icons/lit';
39
- import { ShadowlessElement } from '../../../../std/index.js';
38
+ import { InsertLeftIcon, InsertRightIcon, MoveLeftIcon, MoveRightIcon, } from '@blocksuite/icons/lit';
39
+ import { ShadowlessElement, stdContext } from '../../../../std/index.js';
40
+ import { consume } from '@lit/context';
40
41
  import { css } from 'lit';
41
42
  import { property } from 'lit/decorators.js';
42
43
  import { styleMap } from 'lit/directives/style-map.js';
43
44
  import { html } from 'lit/static-html.js';
44
- import { inputConfig, typeConfig } from '../../../core/common/property-menu.js';
45
+ import { propertyMenuItems } from '../../../core/common/property-menu.js';
46
+ import { wordingOf } from '../../../core/utils/wording.js';
45
47
  import { numberFormats } from '../../../property-presets/number/utils/formats.js';
48
+ import { DATA_VIEW_INSERT_LEFT, DATA_VIEW_INSERT_RIGHT, DATA_VIEW_PROPERTY_SETTINGS, VIEWS_BAR_MOVE_LEFT, VIEWS_BAR_MOVE_RIGHT, } from '../../../translations.js';
46
49
  import { MOBILE_TOUCH_TARGET } from '../consts.js';
47
50
  let MobileTableColumnHeader = (() => {
48
51
  let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
52
+ let _std_decorators;
53
+ let _std_initializers = [];
54
+ let _std_extraInitializers = [];
49
55
  let _column_decorators;
50
56
  let _column_initializers = [];
51
57
  let _column_extraInitializers = [];
@@ -55,8 +61,10 @@ let MobileTableColumnHeader = (() => {
55
61
  return class MobileTableColumnHeader extends _classSuper {
56
62
  static {
57
63
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
64
+ _std_decorators = [consume({ context: stdContext })];
58
65
  _column_decorators = [property({ attribute: false })];
59
66
  _tableViewManager_decorators = [property({ attribute: false })];
67
+ __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);
60
68
  __esDecorate(this, null, _column_decorators, { kind: "accessor", name: "column", static: false, private: false, access: { has: obj => "column" in obj, get: obj => obj.column, set: (obj, value) => { obj.column = value; } }, metadata: _metadata }, _column_initializers, _column_extraInitializers);
61
69
  __esDecorate(this, null, _tableViewManager_decorators, { kind: "accessor", name: "tableViewManager", static: false, private: false, access: { has: obj => "tableViewManager" in obj, get: obj => obj.tableViewManager, set: (obj, value) => { obj.tableViewManager = value; } }, metadata: _metadata }, _tableViewManager_initializers, _tableViewManager_extraInitializers);
62
70
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
@@ -84,16 +92,15 @@ let MobileTableColumnHeader = (() => {
84
92
  `; }
85
93
  popMenu(ele) {
86
94
  const enableNumberFormatting = this.tableViewManager.featureFlags$.value.enable_number_formatting;
95
+ const wording = wordingOf(this.std);
87
96
  popMenu(popupTargetFromElement(ele ?? this), {
88
97
  options: {
89
98
  title: {
90
- text: 'Property settings',
99
+ text: wording(DATA_VIEW_PROPERTY_SETTINGS),
91
100
  },
92
- items: [
93
- inputConfig(this.column),
94
- typeConfig(this.column),
95
- // Number format begin
96
- ...(enableNumberFormatting
101
+ items: propertyMenuItems(this.column, {
102
+ wording,
103
+ afterType: enableNumberFormatting
97
104
  ? [
98
105
  menu.subMenu({
99
106
  name: 'Number Format',
@@ -127,122 +134,88 @@ let MobileTableColumnHeader = (() => {
127
134
  },
128
135
  }),
129
136
  ]
130
- : []),
131
- // Number format end
132
- menu.group({
133
- items: [
134
- menu.action({
135
- name: 'Hide In View',
136
- prefix: ViewIcon(),
137
- hide: () => !this.column.hideCanSet,
138
- select: () => {
139
- this.column.hideSet(true);
140
- },
141
- }),
142
- ],
143
- }),
144
- menu.group({
145
- items: [
146
- menu.action({
147
- name: 'Insert Left Column',
148
- prefix: InsertLeftIcon(),
149
- select: () => {
150
- this.tableViewManager.propertyAdd({
151
- id: this.column.id,
152
- before: true,
153
- });
154
- Promise.resolve()
155
- .then(() => {
156
- const pre = this.previousElementSibling?.previousElementSibling;
157
- if (pre instanceof MobileTableColumnHeader) {
158
- pre.editTitle();
159
- pre.scrollIntoView({
160
- inline: 'nearest',
161
- block: 'nearest',
162
- });
137
+ : [],
138
+ beforeOperations: [
139
+ menu.group({
140
+ items: [
141
+ menu.action({
142
+ name: wording(DATA_VIEW_INSERT_LEFT),
143
+ prefix: InsertLeftIcon(),
144
+ select: () => {
145
+ this.tableViewManager.propertyAdd({
146
+ id: this.column.id,
147
+ before: true,
148
+ });
149
+ Promise.resolve()
150
+ .then(() => {
151
+ const pre = this.previousElementSibling?.previousElementSibling;
152
+ if (pre instanceof MobileTableColumnHeader) {
153
+ pre.editTitle();
154
+ pre.scrollIntoView({
155
+ inline: 'nearest',
156
+ block: 'nearest',
157
+ });
158
+ }
159
+ })
160
+ .catch(console.error);
161
+ },
162
+ }),
163
+ menu.action({
164
+ name: wording(DATA_VIEW_INSERT_RIGHT),
165
+ prefix: InsertRightIcon(),
166
+ select: () => {
167
+ this.tableViewManager.propertyAdd({
168
+ id: this.column.id,
169
+ before: false,
170
+ });
171
+ Promise.resolve()
172
+ .then(() => {
173
+ const next = this.nextElementSibling?.nextElementSibling;
174
+ if (next instanceof MobileTableColumnHeader) {
175
+ next.editTitle();
176
+ next.scrollIntoView({
177
+ inline: 'nearest',
178
+ block: 'nearest',
179
+ });
180
+ }
181
+ })
182
+ .catch(console.error);
183
+ },
184
+ }),
185
+ menu.action({
186
+ name: wording(VIEWS_BAR_MOVE_LEFT),
187
+ prefix: MoveLeftIcon(),
188
+ hide: () => this.column.isFirst$.value,
189
+ select: () => {
190
+ const pre = this.column.prev$.value;
191
+ if (!pre) {
192
+ return;
163
193
  }
164
- })
165
- .catch(console.error);
166
- },
167
- }),
168
- menu.action({
169
- name: 'Insert Right Column',
170
- prefix: InsertRightIcon(),
171
- select: () => {
172
- this.tableViewManager.propertyAdd({
173
- id: this.column.id,
174
- before: false,
175
- });
176
- Promise.resolve()
177
- .then(() => {
178
- const next = this.nextElementSibling?.nextElementSibling;
179
- if (next instanceof MobileTableColumnHeader) {
180
- next.editTitle();
181
- next.scrollIntoView({
182
- inline: 'nearest',
183
- block: 'nearest',
184
- });
194
+ this.column.move({
195
+ id: pre.id,
196
+ before: true,
197
+ });
198
+ },
199
+ }),
200
+ menu.action({
201
+ name: wording(VIEWS_BAR_MOVE_RIGHT),
202
+ prefix: MoveRightIcon(),
203
+ hide: () => this.column.isLast$.value,
204
+ select: () => {
205
+ const next = this.column.next$.value;
206
+ if (!next) {
207
+ return;
185
208
  }
186
- })
187
- .catch(console.error);
188
- },
189
- }),
190
- menu.action({
191
- name: 'Move Left',
192
- prefix: MoveLeftIcon(),
193
- hide: () => this.column.isFirst$.value,
194
- select: () => {
195
- const pre = this.column.prev$.value;
196
- if (!pre) {
197
- return;
198
- }
199
- this.column.move({
200
- id: pre.id,
201
- before: true,
202
- });
203
- },
204
- }),
205
- menu.action({
206
- name: 'Move Right',
207
- prefix: MoveRightIcon(),
208
- hide: () => this.column.isLast$.value,
209
- select: () => {
210
- const next = this.column.next$.value;
211
- if (!next) {
212
- return;
213
- }
214
- this.column.move({
215
- id: next.id,
216
- before: false,
217
- });
218
- },
219
- }),
220
- ],
221
- }),
222
- menu.group({
223
- items: [
224
- menu.action({
225
- name: 'Duplicate',
226
- prefix: DuplicateIcon(),
227
- hide: () => !this.column.canDuplicate,
228
- select: () => {
229
- this.column.duplicate?.();
230
- },
231
- }),
232
- menu.action({
233
- name: 'Delete',
234
- prefix: DeleteIcon(),
235
- hide: () => !this.column.canDelete,
236
- select: () => {
237
- this.column.delete?.();
238
- },
239
- class: {
240
- 'delete-item': true,
241
- },
242
- }),
243
- ],
244
- }),
245
- ],
209
+ this.column.move({
210
+ id: next.id,
211
+ before: false,
212
+ });
213
+ },
214
+ }),
215
+ ],
216
+ }),
217
+ ],
218
+ }),
246
219
  },
247
220
  });
248
221
  }
@@ -265,6 +238,10 @@ let MobileTableColumnHeader = (() => {
265
238
  </div>
266
239
  `;
267
240
  }
241
+ #std_accessor_storage;
242
+ /** Absent outside an editor host: the menu reads English. */
243
+ get std() { return this.#std_accessor_storage; }
244
+ set std(value) { this.#std_accessor_storage = value; }
268
245
  #column_accessor_storage;
269
246
  get column() { return this.#column_accessor_storage; }
270
247
  set column(value) { this.#column_accessor_storage = value; }
@@ -282,7 +259,8 @@ let MobileTableColumnHeader = (() => {
282
259
  this.editTitle = () => {
283
260
  this._clickColumn();
284
261
  };
285
- this.#column_accessor_storage = __runInitializers(this, _column_initializers, void 0);
262
+ this.#std_accessor_storage = __runInitializers(this, _std_initializers, void 0);
263
+ this.#column_accessor_storage = (__runInitializers(this, _std_extraInitializers), __runInitializers(this, _column_initializers, void 0));
286
264
  this.#tableViewManager_accessor_storage = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _tableViewManager_initializers, void 0));
287
265
  __runInitializers(this, _tableViewManager_extraInitializers);
288
266
  }
@@ -45,7 +45,7 @@ import { repeat } from 'lit/directives/repeat.js';
45
45
  import { GroupTitle } from '../../../core/group-by/group-title.js';
46
46
  import { hideGroupAction } from '../../../core/group-by/group-visibility.js';
47
47
  import { wordingOf } from '../../../core/utils/wording.js';
48
- import { DATA_VIEW_GROUP_COLLAPSE, DATA_VIEW_GROUP_EXPAND, } from '../../../translations.js';
48
+ import { DATA_VIEW_GROUP_COLLAPSE, DATA_VIEW_GROUP_EXPAND, DATA_VIEW_NEW_RECORD, } from '../../../translations.js';
49
49
  import { getCollapsedState, setCollapsedState } from '../collapsed-state.js';
50
50
  import { LEFT_TOOL_BAR_WIDTH } from '../consts.js';
51
51
  const styles = css `
@@ -168,7 +168,9 @@ let MobileTableGroup = (() => {
168
168
  data-test-id="affine-database-add-row-button"
169
169
  role="button"
170
170
  >
171
- ${PlusIcon()}<span style="font-size: 12px">New Record</span>
171
+ ${PlusIcon()}<span style="font-size: 12px"
172
+ >${wordingOf(this.std)(DATA_VIEW_NEW_RECORD)}</span
173
+ >
172
174
  </div>
173
175
  </div>`}
174
176
  `;
@@ -42,6 +42,7 @@ import { repeat } from 'lit/directives/repeat.js';
42
42
  import { styleMap } from 'lit/directives/style-map.js';
43
43
  import { html } from 'lit/static-html.js';
44
44
  import { cellDivider } from '../styles.js';
45
+ import { mobileStickyTitle } from './table-view-style.js';
45
46
  let MobileTableHeader = (() => {
46
47
  let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
47
48
  let _renderGroupHeader_decorators;
@@ -85,16 +86,23 @@ let MobileTableHeader = (() => {
85
86
  width: `${column.width$.value}px`,
86
87
  border: index === 0 ? 'none' : undefined,
87
88
  });
89
+ const isTitle = this.tableViewManager.mainProperties$.value.titleColumn ===
90
+ column.id;
88
91
  return html `
89
- <mobile-table-column-header
90
- style="${style}"
91
- data-column-id="${column.id}"
92
- data-column-index="${index}"
93
- class="mobile-table-cell"
94
- .column="${column}"
95
- .tableViewManager="${this.tableViewManager}"
96
- ></mobile-table-column-header>
97
- <div class="${cellDivider}" style="height: auto;"></div>
92
+ <div
93
+ class="${isTitle ? mobileStickyTitle : ''}"
94
+ style="display: flex;"
95
+ >
96
+ <mobile-table-column-header
97
+ style="${style}"
98
+ data-column-id="${column.id}"
99
+ data-column-index="${index}"
100
+ class="mobile-table-cell"
101
+ .column="${column}"
102
+ .tableViewManager="${this.tableViewManager}"
103
+ ></mobile-table-column-header>
104
+ <div class="${cellDivider}" style="height: auto;"></div>
105
+ </div>
98
106
  `;
99
107
  })}
100
108
  <div @click="${this._onAddColumn}" class="mobile-table-add-column">
@@ -46,6 +46,9 @@ import { html } from 'lit/static-html.js';
46
46
  import { paintRowColor, ROW_COLOR_PROPERTY, viewRowColor, } from '../../../core/view/color-rules.js';
47
47
  import { cellDivider } from '../styles.js';
48
48
  import { popMobileRowMenu } from './menu.js';
49
+ import { mobileStickyTitle } from './table-view-style.js';
50
+ /** Two 24px ops, the 20px gap between them and their 8px inset. */
51
+ const ROW_OPS_WIDTH = 24 * 2 + 20 + 8;
49
52
  let MobileTableRow = (() => {
50
53
  let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
51
54
  let _tableViewLogic_decorators;
@@ -137,13 +140,20 @@ let MobileTableRow = (() => {
137
140
  const ele = e.currentTarget;
138
141
  popMobileRowMenu(popupTargetFromElement(ele), this.rowId, this.tableViewLogic, this.view);
139
142
  };
143
+ const isTitle = column.view.mainProperties$.value.titleColumn === column.id;
144
+ const hasOps = isTitle && !column.readonly$.value;
140
145
  return html `
141
- <div style="display: flex;">
146
+ <div
147
+ class="${isTitle ? mobileStickyTitle : ''}"
148
+ style="display: flex;"
149
+ >
142
150
  <mobile-table-cell
143
151
  class="mobile-table-cell"
144
152
  style=${styleMap({
145
153
  width: `${column.width$.value}px`,
146
154
  border: i === 0 ? 'none' : undefined,
155
+ // Room for the two row ops drawn over its right end.
156
+ paddingRight: hasOps ? `${ROW_OPS_WIDTH}px` : undefined,
147
157
  })}
148
158
  .tableViewLogic="${this.tableViewLogic}"
149
159
  .column="${column}"
@@ -158,20 +168,19 @@ let MobileTableRow = (() => {
158
168
  >
159
169
  </mobile-table-cell>
160
170
  <div class="${cellDivider}"></div>
161
- </div>
162
- ${!column.readonly$.value &&
163
- column.view.mainProperties$.value.titleColumn === column.id
171
+ ${hasOps
164
172
  ? html ` <div class="mobile-row-ops">
165
- <div class="mobile-row-op" @click="${clickDetail}">
166
- ${CenterPeekIcon()}
167
- </div>
168
- ${!view.readonly$.value
173
+ <div class="mobile-row-op" @click="${clickDetail}">
174
+ ${CenterPeekIcon()}
175
+ </div>
176
+ ${!view.readonly$.value
169
177
  ? html ` <div class="mobile-row-op" @click="${openMenu}">
170
- ${MoreHorizontalIcon()}
171
- </div>`
178
+ ${MoreHorizontalIcon()}
179
+ </div>`
172
180
  : nothing}
173
- </div>`
181
+ </div>`
174
182
  : nothing}
183
+ </div>
175
184
  `;
176
185
  })}
177
186
  <div class="database-cell add-column-button"></div>
@@ -1,3 +1,20 @@
1
+ /**
2
+ * The view element itself never scrolls: the inner wrapper does.
3
+ *
4
+ * Upstream disabled horizontal scrolling of the mobile table altogether "to
5
+ * prevent crashes on iOS Safari" (AFFiNE#12203, blocksuite#8784), which left
6
+ * every column past the first unreachable on a phone. The scroll now lives on
7
+ * ONE inner element, contained (`overscroll-behavior`) so it never chains into
8
+ * the page; the host stays clipped as before.
9
+ * ponytail: unverified on a real iOS Safari here; if the crash comes back, the
10
+ * fallback is a paged column switcher, not `hidden` again.
11
+ */
12
+ export declare const mobileTableViewHost: string;
1
13
  export declare const mobileTableViewWrapper: string;
14
+ /**
15
+ * The title column stays in view while the others scroll under it: opaque,
16
+ * with the row's colour painted over the page colour.
17
+ */
18
+ export declare const mobileStickyTitle: string;
2
19
  export declare const mobileTableViewContainer: string;
3
20
  export declare const mobileCellDivider: string;
@@ -1,16 +1,41 @@
1
1
  import { css } from '@emotion/css';
2
2
  import { cssVarV2 } from '@toeverything/theme/v2';
3
+ import { ROW_COLOR_PROPERTY } from '../../../core/view/color-rules.js';
4
+ /**
5
+ * The view element itself never scrolls: the inner wrapper does.
6
+ *
7
+ * Upstream disabled horizontal scrolling of the mobile table altogether "to
8
+ * prevent crashes on iOS Safari" (AFFiNE#12203, blocksuite#8784), which left
9
+ * every column past the first unreachable on a phone. The scroll now lives on
10
+ * ONE inner element, contained (`overscroll-behavior`) so it never chains into
11
+ * the page; the host stays clipped as before.
12
+ * ponytail: unverified on a real iOS Safari here; if the crash comes back, the
13
+ * fallback is a paged column switcher, not `hidden` again.
14
+ */
15
+ export const mobileTableViewHost = css({
16
+ position: 'relative',
17
+ width: '100%',
18
+ overflowX: 'hidden',
19
+ overflowY: 'hidden',
20
+ });
3
21
  export const mobileTableViewWrapper = css({
4
22
  position: 'relative',
5
23
  width: '100%',
6
24
  paddingBottom: '4px',
7
- /**
8
- * Disable horizontal scrolling to prevent crashes on iOS Safari
9
- * See https://github.com/toeverything/AFFiNE/pull/12203
10
- * and https://github.com/toeverything/blocksuite/pull/8784
11
- */
12
- overflowX: 'hidden',
25
+ overflowX: 'auto',
13
26
  overflowY: 'hidden',
27
+ overscrollBehaviorX: 'contain',
28
+ });
29
+ /**
30
+ * The title column stays in view while the others scroll under it: opaque,
31
+ * with the row's colour painted over the page colour.
32
+ */
33
+ export const mobileStickyTitle = css({
34
+ position: 'sticky',
35
+ left: 0,
36
+ zIndex: 1,
37
+ backgroundColor: 'var(--affine-background-primary-color)',
38
+ backgroundImage: `linear-gradient(var(${ROW_COLOR_PROPERTY}, transparent), var(${ROW_COLOR_PROPERTY}, transparent))`,
14
39
  });
15
40
  export const mobileTableViewContainer = css({
16
41
  position: 'relative',
@@ -7,7 +7,7 @@ import { html } from 'lit/static-html.js';
7
7
  import { createUniComponentFromWebComponent, renderUniLit, } from '../../../core/index.js';
8
8
  import { DataViewUIBase, DataViewUILogicBase, } from '../../../core/view/data-view-base.js';
9
9
  import { LEFT_TOOL_BAR_WIDTH } from '../consts.js';
10
- import { mobileTableViewContainer, mobileTableViewWrapper, } from './table-view-style.js';
10
+ import { mobileTableViewContainer, mobileTableViewHost, mobileTableViewWrapper, } from './table-view-style.js';
11
11
  export class MobileTableViewUILogic extends DataViewUILogicBase {
12
12
  constructor() {
13
13
  super(...arguments);
@@ -71,7 +71,7 @@ export class MobileTableViewUI extends DataViewUIBase {
71
71
  connectedCallback() {
72
72
  super.connectedCallback();
73
73
  this.logic.ui$.value = this;
74
- this.classList.add(mobileTableViewWrapper);
74
+ this.classList.add(mobileTableViewHost);
75
75
  }
76
76
  renderTable() {
77
77
  const groups = this.logic.view.groupTrait.visibleGroups$.value;
@@ -48,7 +48,7 @@ import { createDndContext } from '../../../core/utils/wc-dnd/dnd-context.js';
48
48
  import { defaultActivators } from '../../../core/utils/wc-dnd/sensors/index.js';
49
49
  import { linearMove } from '../../../core/utils/wc-dnd/utils/linear-move.js';
50
50
  import { wordingOf } from '../../../core/utils/wording.js';
51
- import { DATA_VIEW_GROUP_COLLAPSE, DATA_VIEW_GROUP_EXPAND, } from '../../../translations.js';
51
+ import { DATA_VIEW_GROUP_COLLAPSE, DATA_VIEW_GROUP_EXPAND, DATA_VIEW_NEW_RECORD, } from '../../../translations.js';
52
52
  import { getCollapsedState, setCollapsedState } from '../collapsed-state.js';
53
53
  import { LEFT_TOOL_BAR_WIDTH } from '../consts.js';
54
54
  import { TableViewAreaSelection } from '../selection.js';
@@ -193,7 +193,9 @@ let TableGroup = (() => {
193
193
  data-test-id="affine-database-add-row-button"
194
194
  role="button"
195
195
  >
196
- ${PlusIcon()}<span style="font-size: 12px">New Record</span>
196
+ ${PlusIcon()}<span style="font-size: 12px"
197
+ >${wordingOf(this.std)(DATA_VIEW_NEW_RECORD)}</span
198
+ >
197
199
  </div>
198
200
  </div>`}
199
201
  <affine-database-column-stats
@@ -1,4 +1,4 @@
1
- import { ShadowlessElement } from '../../../../std/index.js';
1
+ import { type BlockStdScope, ShadowlessElement } from '../../../../std/index.js';
2
2
  import { type ReadonlySignal } from '@preact/signals-core';
3
3
  import type { Variable } from '../../../core/expression/types.js';
4
4
  import type { Filter, FilterGroup } from '../../../core/filter/types.js';
@@ -22,6 +22,8 @@ export declare class FilterBar extends FilterBar_base {
22
22
  accessor onChange: (filter: FilterGroup) => void;
23
23
  accessor vars: ReadonlySignal<Variable[]>;
24
24
  accessor dataViewLogic: DataViewUILogicBase;
25
+ /** Absent outside an editor host: the wordings read English. */
26
+ accessor std: BlockStdScope;
25
27
  }
26
28
  declare global {
27
29
  interface HTMLElementTagNameMap {
@@ -35,11 +35,14 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
35
35
  import { popupTargetFromElement, } from '../../../../affine-components/context-menu/index.js';
36
36
  import { SignalWatcher } from '../../../../global/lit/index.js';
37
37
  import { ArrowDownSmallIcon, FilterIcon, PlusIcon, } 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 { computed } from '@preact/signals-core';
40
41
  import { css, html } from 'lit';
41
42
  import { property } from 'lit/decorators.js';
42
43
  import { popCreateFilter } from '../../../core/index.js';
44
+ import { wordingOf } from '../../../core/utils/wording.js';
45
+ import { DATA_VIEW_ADD_FILTER } from '../../../translations.js';
43
46
  import { popFilterGroup } from './group-panel-view.js';
44
47
  let FilterBar = (() => {
45
48
  let _classSuper = SignalWatcher(ShadowlessElement);
@@ -55,6 +58,9 @@ let FilterBar = (() => {
55
58
  let _dataViewLogic_decorators;
56
59
  let _dataViewLogic_initializers = [];
57
60
  let _dataViewLogic_extraInitializers = [];
61
+ let _std_decorators;
62
+ let _std_initializers = [];
63
+ let _std_extraInitializers = [];
58
64
  return class FilterBar extends _classSuper {
59
65
  static {
60
66
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
@@ -62,10 +68,12 @@ let FilterBar = (() => {
62
68
  _onChange_decorators = [property({ attribute: false })];
63
69
  _vars_decorators = [property({ attribute: false })];
64
70
  _dataViewLogic_decorators = [property({ attribute: false })];
71
+ _std_decorators = [consume({ context: stdContext })];
65
72
  __esDecorate(this, null, _filterGroup_decorators, { kind: "accessor", name: "filterGroup", static: false, private: false, access: { has: obj => "filterGroup" in obj, get: obj => obj.filterGroup, set: (obj, value) => { obj.filterGroup = value; } }, metadata: _metadata }, _filterGroup_initializers, _filterGroup_extraInitializers);
66
73
  __esDecorate(this, null, _onChange_decorators, { kind: "accessor", name: "onChange", static: false, private: false, access: { has: obj => "onChange" in obj, get: obj => obj.onChange, set: (obj, value) => { obj.onChange = value; } }, metadata: _metadata }, _onChange_initializers, _onChange_extraInitializers);
67
74
  __esDecorate(this, null, _vars_decorators, { kind: "accessor", name: "vars", static: false, private: false, access: { has: obj => "vars" in obj, get: obj => obj.vars, set: (obj, value) => { obj.vars = value; } }, metadata: _metadata }, _vars_initializers, _vars_extraInitializers);
68
75
  __esDecorate(this, null, _dataViewLogic_decorators, { kind: "accessor", name: "dataViewLogic", static: false, private: false, access: { has: obj => "dataViewLogic" in obj, get: obj => obj.dataViewLogic, set: (obj, value) => { obj.dataViewLogic = value; } }, metadata: _metadata }, _dataViewLogic_initializers, _dataViewLogic_extraInitializers);
76
+ __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);
69
77
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
70
78
  }
71
79
  static { this.styles = css `
@@ -102,6 +110,13 @@ let FilterBar = (() => {
102
110
  line-height: 22px;
103
111
  }
104
112
 
113
+ /* A finger needs 44px: the host's touch-target floor (P7). */
114
+ @media (pointer: coarse) {
115
+ .filter-bar-add-filter {
116
+ min-height: 44px;
117
+ }
118
+ }
119
+
105
120
  filter-bar::-webkit-scrollbar {
106
121
  -webkit-appearance: none;
107
122
  display: block;
@@ -178,6 +193,10 @@ let FilterBar = (() => {
178
193
  #dataViewLogic_accessor_storage;
179
194
  get dataViewLogic() { return this.#dataViewLogic_accessor_storage; }
180
195
  set dataViewLogic(value) { this.#dataViewLogic_accessor_storage = value; }
196
+ #std_accessor_storage;
197
+ /** Absent outside an editor host: the wordings read English. */
198
+ get std() { return this.#std_accessor_storage; }
199
+ set std(value) { this.#std_accessor_storage = value; }
181
200
  constructor() {
182
201
  super(...arguments);
183
202
  this._setFilter = (index, filter) => {
@@ -232,7 +251,7 @@ let FilterBar = (() => {
232
251
  class="filter-bar-add-filter dv-icon-16 dv-round-4 dv-hover"
233
252
  @click="${this.addFilter}"
234
253
  >
235
- ${PlusIcon()} Add filter
254
+ ${PlusIcon()} ${wordingOf(this.std)(DATA_VIEW_ADD_FILTER)}
236
255
  </div>`;
237
256
  };
238
257
  this.setConditions = (conditions) => {
@@ -244,7 +263,8 @@ let FilterBar = (() => {
244
263
  this.#onChange_accessor_storage = __runInitializers(this, _onChange_initializers, void 0);
245
264
  this.#vars_accessor_storage = (__runInitializers(this, _onChange_extraInitializers), __runInitializers(this, _vars_initializers, void 0));
246
265
  this.#dataViewLogic_accessor_storage = (__runInitializers(this, _vars_extraInitializers), __runInitializers(this, _dataViewLogic_initializers, void 0));
247
- __runInitializers(this, _dataViewLogic_extraInitializers);
266
+ this.#std_accessor_storage = (__runInitializers(this, _dataViewLogic_extraInitializers), __runInitializers(this, _std_initializers, void 0));
267
+ __runInitializers(this, _std_extraInitializers);
248
268
  }
249
269
  };
250
270
  })();
@@ -1,3 +1,4 @@
1
+ import { type BlockStdScope } from '../../../../../std/index.js';
1
2
  import { WidgetBase } from '../../../../core/widget/widget-base.js';
2
3
  import type { KanbanViewUILogic } from '../../../../view-presets/kanban/pc/kanban-view-ui-logic.js';
3
4
  import type { VirtualTableViewUILogic } from '../../../../view-presets/table/pc-virtual/table-view-ui-logic.js';
@@ -9,6 +10,8 @@ export declare class DataViewHeaderToolsSearch extends WidgetBase<VirtualTableVi
9
10
  private readonly _onSearchBlur;
10
11
  private readonly _onSearchKeydown;
11
12
  preventBlur: boolean;
13
+ /** Absent outside an editor host: the wordings read English. */
14
+ accessor std: BlockStdScope;
12
15
  connectedCallback(): void;
13
16
  render(): import("lit-html").TemplateResult<1>;
14
17
  private accessor _searchInput;