@formicoidea/labre-core 0.47.1 → 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.
- package/dist/_pkgs/affine-block-data-view/configs/slash-menu.js +3 -1
- package/dist/_pkgs/affine-block-data-view/view.d.ts +17 -1
- package/dist/_pkgs/affine-block-data-view/view.js +21 -2
- package/dist/_pkgs/affine-block-database/commands.d.ts +2 -2
- package/dist/_pkgs/affine-block-database/commands.js +3 -3
- package/dist/_pkgs/affine-block-database/components/values-banner.d.ts +28 -0
- package/dist/_pkgs/affine-block-database/components/values-banner.js +199 -0
- package/dist/_pkgs/affine-block-database/configs/slash-menu.d.ts +6 -1
- package/dist/_pkgs/affine-block-database/configs/slash-menu.js +57 -70
- package/dist/_pkgs/affine-block-database/data-source.d.ts +9 -5
- package/dist/_pkgs/affine-block-database/data-source.js +11 -7
- package/dist/_pkgs/affine-block-database/database-block-styles.d.ts +2 -0
- package/dist/_pkgs/affine-block-database/database-block-styles.js +15 -0
- package/dist/_pkgs/affine-block-database/database-block.d.ts +23 -0
- package/dist/_pkgs/affine-block-database/database-block.js +141 -19
- package/dist/_pkgs/affine-block-database/effects.js +2 -0
- package/dist/_pkgs/affine-block-database/external-data-source.d.ts +69 -2
- package/dist/_pkgs/affine-block-database/external-data-source.js +88 -16
- package/dist/_pkgs/affine-block-database/index.d.ts +2 -0
- package/dist/_pkgs/affine-block-database/index.js +2 -0
- package/dist/_pkgs/affine-block-database/linked-view.d.ts +38 -0
- package/dist/_pkgs/affine-block-database/linked-view.js +109 -0
- package/dist/_pkgs/affine-block-database/properties/index.d.ts +2 -0
- package/dist/_pkgs/affine-block-database/properties/index.js +2 -0
- package/dist/_pkgs/affine-block-database/properties/text/hosted.d.ts +15 -0
- package/dist/_pkgs/affine-block-database/properties/text/hosted.js +24 -0
- package/dist/_pkgs/affine-block-database/properties/title/hosted.d.ts +16 -0
- package/dist/_pkgs/affine-block-database/properties/title/hosted.js +42 -0
- package/dist/_pkgs/affine-block-database/service/index.d.ts +3 -0
- package/dist/_pkgs/affine-block-database/service/index.js +3 -0
- package/dist/_pkgs/affine-block-database/service/new-row-menu.d.ts +49 -0
- package/dist/_pkgs/affine-block-database/service/new-row-menu.js +21 -0
- package/dist/_pkgs/affine-block-database/service/open-row.d.ts +77 -0
- package/dist/_pkgs/affine-block-database/service/open-row.js +62 -0
- package/dist/_pkgs/affine-block-database/service/properties-panel.d.ts +23 -0
- package/dist/_pkgs/affine-block-database/service/properties-panel.js +33 -0
- package/dist/_pkgs/affine-block-database/translations.d.ts +10 -0
- package/dist/_pkgs/affine-block-database/translations.js +35 -0
- package/dist/_pkgs/affine-block-database/view-creation.d.ts +10 -0
- package/dist/_pkgs/affine-block-database/view-creation.js +14 -0
- package/dist/_pkgs/affine-block-database/view.d.ts +31 -1
- package/dist/_pkgs/affine-block-database/view.js +48 -4
- package/dist/_pkgs/affine-block-database/views/index.d.ts +30 -3
- package/dist/_pkgs/affine-block-database/views/index.js +44 -3
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/new-doc.d.ts +25 -0
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/new-doc.js +71 -0
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/slash-menu.js +3 -11
- package/dist/_pkgs/affine-components/date-picker/date-picker.d.ts +20 -0
- package/dist/_pkgs/affine-components/date-picker/date-picker.js +60 -26
- package/dist/_pkgs/affine-components/date-picker/style.js +1 -0
- package/dist/_pkgs/affine-components/translations.d.ts +4 -0
- package/dist/_pkgs/affine-components/translations.js +26 -0
- package/dist/_pkgs/affine-fragment-doc-title/doc-title.d.ts +18 -0
- package/dist/_pkgs/affine-fragment-doc-title/doc-title.js +41 -2
- package/dist/_pkgs/affine-fragment-doc-title/index.d.ts +1 -1
- package/dist/_pkgs/affine-fragment-doc-title/index.js +1 -1
- package/dist/_pkgs/affine-fragment-doc-title/title-band/band-cell.d.ts +30 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/band-cell.js +137 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/format.d.ts +7 -19
- package/dist/_pkgs/affine-fragment-doc-title/title-band/format.js +0 -38
- package/dist/_pkgs/affine-fragment-doc-title/title-band/show-here.d.ts +19 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/show-here.js +61 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.d.ts +33 -18
- package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.js +263 -205
- package/dist/_pkgs/affine-fragment-doc-title/translations.d.ts +7 -4
- package/dist/_pkgs/affine-fragment-doc-title/translations.js +12 -9
- package/dist/_pkgs/affine-model/blocks/database/types.d.ts +16 -0
- package/dist/_pkgs/affine-model/blocks/database/types.js +5 -1
- package/dist/_pkgs/affine-shared/services/data-source-picker-service.d.ts +139 -0
- package/dist/_pkgs/affine-shared/services/data-source-picker-service.js +22 -0
- package/dist/_pkgs/affine-shared/services/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/services/index.js +1 -0
- package/dist/_pkgs/affine-shared/services/linked-doc-creation-service.d.ts +15 -6
- package/dist/_pkgs/affine-shared/services/telemetry-service/database.d.ts +59 -0
- package/dist/_pkgs/affine-shared/services/title-band-service.d.ts +34 -7
- package/dist/_pkgs/affine-shared/utils/model/doc.d.ts +10 -2
- package/dist/_pkgs/affine-shared/utils/model/doc.js +17 -7
- package/dist/_pkgs/data-view/core/component/cell-status/cell-status-css.d.ts +2 -0
- package/dist/_pkgs/data-view/core/component/cell-status/cell-status-css.js +16 -0
- package/dist/_pkgs/data-view/core/component/cell-status/cell-status.d.ts +10 -0
- package/dist/_pkgs/data-view/core/component/cell-status/cell-status.js +23 -0
- package/dist/_pkgs/data-view/core/component/index.d.ts +1 -0
- package/dist/_pkgs/data-view/core/component/index.js +1 -0
- package/dist/_pkgs/data-view/core/component/overflow/fit.d.ts +26 -0
- package/dist/_pkgs/data-view/core/component/overflow/fit.js +48 -0
- package/dist/_pkgs/data-view/core/component/overflow/overflow.d.ts +26 -3
- package/dist/_pkgs/data-view/core/component/overflow/overflow.js +84 -31
- package/dist/_pkgs/data-view/core/component/tags/colors.d.ts +7 -0
- package/dist/_pkgs/data-view/core/component/tags/colors.js +22 -10
- package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.d.ts +25 -2
- package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.js +81 -32
- package/dist/_pkgs/data-view/core/data-source/base.d.ts +5 -1
- package/dist/_pkgs/data-view/core/data-source/base.js +7 -1
- package/dist/_pkgs/data-view/core/data-source/hydration.d.ts +44 -0
- package/dist/_pkgs/data-view/core/data-source/hydration.js +31 -0
- package/dist/_pkgs/data-view/core/data-source/index.d.ts +1 -0
- package/dist/_pkgs/data-view/core/data-source/index.js +1 -0
- package/dist/_pkgs/data-view/core/data-view.d.ts +22 -2
- package/dist/_pkgs/data-view/core/data-view.js +14 -0
- package/dist/_pkgs/data-view/core/effect.js +4 -0
- package/dist/_pkgs/data-view/core/group-by/collapsed-state.d.ts +3 -0
- package/dist/_pkgs/data-view/core/group-by/collapsed-state.js +59 -0
- package/dist/_pkgs/data-view/core/group-by/group-properties.d.ts +21 -0
- package/dist/_pkgs/data-view/core/group-by/group-properties.js +38 -0
- package/dist/_pkgs/data-view/core/group-by/group-title.js +4 -0
- package/dist/_pkgs/data-view/core/group-by/group-visibility.d.ts +40 -0
- package/dist/_pkgs/data-view/core/group-by/group-visibility.js +291 -0
- package/dist/_pkgs/data-view/core/group-by/setting.d.ts +11 -3
- package/dist/_pkgs/data-view/core/group-by/setting.js +81 -8
- package/dist/_pkgs/data-view/core/group-by/trait.d.ts +22 -0
- package/dist/_pkgs/data-view/core/group-by/trait.js +62 -1
- package/dist/_pkgs/data-view/core/index.d.ts +3 -0
- package/dist/_pkgs/data-view/core/index.js +3 -0
- package/dist/_pkgs/data-view/core/property/base-cell.d.ts +15 -1
- package/dist/_pkgs/data-view/core/property/base-cell.js +28 -3
- package/dist/_pkgs/data-view/core/property/index.d.ts +1 -0
- package/dist/_pkgs/data-view/core/property/index.js +1 -0
- package/dist/_pkgs/data-view/core/property/standalone-cell.d.ts +109 -0
- package/dist/_pkgs/data-view/core/property/standalone-cell.js +324 -0
- package/dist/_pkgs/data-view/core/telemetry.d.ts +16 -0
- package/dist/_pkgs/data-view/core/telemetry.js +22 -0
- package/dist/_pkgs/data-view/core/utils/new-tab-click.d.ts +2 -0
- package/dist/_pkgs/data-view/core/utils/new-tab-click.js +4 -0
- package/dist/_pkgs/data-view/core/utils/wording.d.ts +11 -0
- package/dist/_pkgs/data-view/core/utils/wording.js +9 -0
- package/dist/_pkgs/data-view/core/view/data-view.d.ts +7 -0
- package/dist/_pkgs/data-view/core/view/default-name.d.ts +10 -0
- package/dist/_pkgs/data-view/core/view/default-name.js +14 -0
- package/dist/_pkgs/data-view/core/view/index.d.ts +2 -0
- package/dist/_pkgs/data-view/core/view/index.js +2 -0
- package/dist/_pkgs/data-view/core/view/open-in.d.ts +27 -0
- package/dist/_pkgs/data-view/core/view/open-in.js +39 -0
- package/dist/_pkgs/data-view/core/view-manager/cell.d.ts +5 -0
- package/dist/_pkgs/data-view/core/view-manager/cell.js +11 -0
- package/dist/_pkgs/data-view/core/view-manager/index.d.ts +3 -0
- package/dist/_pkgs/data-view/core/view-manager/index.js +3 -0
- package/dist/_pkgs/data-view/core/view-manager/new-row-menu-opener.d.ts +18 -0
- package/dist/_pkgs/data-view/core/view-manager/new-row-menu-opener.js +2 -0
- package/dist/_pkgs/data-view/core/view-manager/properties-panel-opener.d.ts +8 -0
- package/dist/_pkgs/data-view/core/view-manager/properties-panel-opener.js +9 -0
- package/dist/_pkgs/data-view/core/view-manager/property.d.ts +14 -0
- package/dist/_pkgs/data-view/core/view-manager/single-view.d.ts +28 -1
- package/dist/_pkgs/data-view/core/view-manager/single-view.js +45 -1
- package/dist/_pkgs/data-view/core/view-manager/view-creation.d.ts +49 -0
- package/dist/_pkgs/data-view/core/view-manager/view-creation.js +40 -0
- package/dist/_pkgs/data-view/core/view-manager/view-manager.d.ts +6 -2
- package/dist/_pkgs/data-view/core/view-manager/view-manager.js +2 -2
- package/dist/_pkgs/data-view/property-presets/date/cell-renderer.d.ts +2 -0
- package/dist/_pkgs/data-view/property-presets/date/cell-renderer.js +11 -2
- package/dist/_pkgs/data-view/property-presets/multi-select/cell-renderer.js +3 -1
- package/dist/_pkgs/data-view/property-presets/select/cell-renderer.js +3 -1
- package/dist/_pkgs/data-view/property-presets/text/cell-renderer.js +3 -1
- package/dist/_pkgs/data-view/translations.d.ts +55 -0
- package/dist/_pkgs/data-view/translations.js +181 -0
- package/dist/_pkgs/data-view/view-presets/calendar/define.js +3 -1
- package/dist/_pkgs/data-view/view-presets/convert.js +2 -0
- package/dist/_pkgs/data-view/view-presets/effect.js +4 -0
- package/dist/_pkgs/data-view/view-presets/flat/flat-converts.d.ts +2 -0
- package/dist/_pkgs/data-view/view-presets/flat/flat-converts.js +35 -0
- package/dist/_pkgs/data-view/view-presets/flat/flat-view-manager.d.ts +79 -0
- package/dist/_pkgs/data-view/view-presets/flat/flat-view-manager.js +194 -0
- package/dist/_pkgs/data-view/view-presets/flat/flat-view-ui.d.ts +56 -0
- package/dist/_pkgs/data-view/view-presets/flat/flat-view-ui.js +266 -0
- package/dist/_pkgs/data-view/view-presets/gallery/define.d.ts +14 -0
- package/dist/_pkgs/data-view/view-presets/gallery/define.js +15 -0
- package/dist/_pkgs/data-view/view-presets/gallery/effect.d.ts +1 -0
- package/dist/_pkgs/data-view/view-presets/gallery/effect.js +4 -0
- package/dist/_pkgs/data-view/view-presets/gallery/gallery-view.d.ts +27 -0
- package/dist/_pkgs/data-view/view-presets/gallery/gallery-view.js +179 -0
- package/dist/_pkgs/data-view/view-presets/gallery/index.d.ts +2 -0
- package/dist/_pkgs/data-view/view-presets/gallery/index.js +2 -0
- package/dist/_pkgs/data-view/view-presets/gallery/renderer.d.ts +1 -0
- package/dist/_pkgs/data-view/view-presets/gallery/renderer.js +11 -0
- package/dist/_pkgs/data-view/view-presets/index.d.ts +5 -0
- package/dist/_pkgs/data-view/view-presets/index.js +7 -0
- package/dist/_pkgs/data-view/view-presets/kanban/define.js +3 -1
- package/dist/_pkgs/data-view/view-presets/kanban/kanban-view-manager.js +5 -53
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/card.js +8 -1
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/cell.js +6 -1
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/group.d.ts +4 -2
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/group.js +52 -6
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/kanban-view-ui-logic.js +5 -1
- package/dist/_pkgs/data-view/view-presets/kanban/pc/card.js +2 -0
- package/dist/_pkgs/data-view/view-presets/kanban/pc/cell.js +4 -0
- package/dist/_pkgs/data-view/view-presets/kanban/pc/group.d.ts +4 -2
- package/dist/_pkgs/data-view/view-presets/kanban/pc/group.js +51 -6
- package/dist/_pkgs/data-view/view-presets/kanban/pc/kanban-view-ui-logic.js +5 -1
- package/dist/_pkgs/data-view/view-presets/list/define.d.ts +14 -0
- package/dist/_pkgs/data-view/view-presets/list/define.js +15 -0
- package/dist/_pkgs/data-view/view-presets/list/effect.d.ts +1 -0
- package/dist/_pkgs/data-view/view-presets/list/effect.js +4 -0
- package/dist/_pkgs/data-view/view-presets/list/index.d.ts +2 -0
- package/dist/_pkgs/data-view/view-presets/list/index.js +2 -0
- package/dist/_pkgs/data-view/view-presets/list/list-view.d.ts +24 -0
- package/dist/_pkgs/data-view/view-presets/list/list-view.js +194 -0
- package/dist/_pkgs/data-view/view-presets/list/renderer.d.ts +1 -0
- package/dist/_pkgs/data-view/view-presets/list/renderer.js +11 -0
- package/dist/_pkgs/data-view/view-presets/table/collapsed-state.d.ts +3 -14
- package/dist/_pkgs/data-view/view-presets/table/collapsed-state.js +6 -30
- package/dist/_pkgs/data-view/view-presets/table/consts.d.ts +2 -0
- package/dist/_pkgs/data-view/view-presets/table/consts.js +2 -0
- package/dist/_pkgs/data-view/view-presets/table/define.js +3 -1
- package/dist/_pkgs/data-view/view-presets/table/mobile/cell.js +4 -1
- package/dist/_pkgs/data-view/view-presets/table/mobile/column-header.js +2 -2
- package/dist/_pkgs/data-view/view-presets/table/mobile/group.d.ts +3 -1
- package/dist/_pkgs/data-view/view-presets/table/mobile/group.js +20 -5
- package/dist/_pkgs/data-view/view-presets/table/mobile/row.js +10 -2
- package/dist/_pkgs/data-view/view-presets/table/mobile/table-view-ui-logic.js +4 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/cell.js +4 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/controller/hotkeys.js +1 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/group.d.ts +3 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/group.js +20 -5
- package/dist/_pkgs/data-view/view-presets/table/pc/menu.d.ts +1 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/menu.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/row/row.js +3 -2
- package/dist/_pkgs/data-view/view-presets/table/pc/table-view-ui-logic.js +4 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/hotkeys.js +1 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/bottom/stats/column-stats-column.js +5 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/group-title.js +22 -19
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/row/cell.js +4 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/table-view-ui-logic.js +7 -2
- package/dist/_pkgs/data-view/view-presets/table/stats/column-stats-column.js +5 -1
- package/dist/_pkgs/data-view/view-presets/table/table-view-manager.js +5 -53
- package/dist/_pkgs/data-view/widget-presets/tools/presets/table-add-row/add-row.d.ts +1 -0
- package/dist/_pkgs/data-view/widget-presets/tools/presets/table-add-row/add-row.js +60 -2
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-options.d.ts +18 -1
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-options.js +121 -124
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.d.ts +43 -0
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.js +187 -0
- package/dist/_pkgs/data-view/widget-presets/views-bar/views-view.d.ts +36 -3
- package/dist/_pkgs/data-view/widget-presets/views-bar/views-view.js +187 -59
- package/dist/extensions/view.d.ts +2 -2
- package/dist/extensions/view.js +10 -3
- package/dist/flags.d.ts +8 -4
- package/dist/flags.js +8 -4
- package/dist/frameworks.d.ts +27 -0
- package/dist/frameworks.js +28 -0
- package/dist/translations.js +13 -1
- package/package.json +5 -1
|
@@ -37,7 +37,7 @@ import { focusTextModel } from '../affine-rich-text/index.js';
|
|
|
37
37
|
import { TitleBandProvider, translateKey } from '../affine-shared/services/index.js';
|
|
38
38
|
import { matchModels } from '../affine-shared/utils/index.js';
|
|
39
39
|
import { WithDisposable } from '../global/lit/index.js';
|
|
40
|
-
import { ShadowlessElement } from '../std/index.js';
|
|
40
|
+
import { ShadowlessElement, } from '../std/index.js';
|
|
41
41
|
import { effect } from '@preact/signals-core';
|
|
42
42
|
import { css, html, nothing } from 'lit';
|
|
43
43
|
import { property, query, state } from 'lit/decorators.js';
|
|
@@ -60,6 +60,9 @@ let DocTitle = (() => {
|
|
|
60
60
|
let _wrapText_decorators;
|
|
61
61
|
let _wrapText_initializers = [];
|
|
62
62
|
let _wrapText_extraInitializers = [];
|
|
63
|
+
let _bodyBlockId_decorators;
|
|
64
|
+
let _bodyBlockId_initializers = [];
|
|
65
|
+
let _bodyBlockId_extraInitializers = [];
|
|
63
66
|
return class DocTitle extends _classSuper {
|
|
64
67
|
static {
|
|
65
68
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
@@ -68,11 +71,13 @@ let DocTitle = (() => {
|
|
|
68
71
|
__richTextElement_decorators = [query('rich-text')];
|
|
69
72
|
_doc_decorators = [property({ attribute: false })];
|
|
70
73
|
_wrapText_decorators = [property({ attribute: false })];
|
|
74
|
+
_bodyBlockId_decorators = [property({ attribute: false })];
|
|
71
75
|
__esDecorate(this, null, __isComposing_decorators, { kind: "accessor", name: "_isComposing", static: false, private: false, access: { has: obj => "_isComposing" in obj, get: obj => obj._isComposing, set: (obj, value) => { obj._isComposing = value; } }, metadata: _metadata }, __isComposing_initializers, __isComposing_extraInitializers);
|
|
72
76
|
__esDecorate(this, null, __isReadonly_decorators, { kind: "accessor", name: "_isReadonly", static: false, private: false, access: { has: obj => "_isReadonly" in obj, get: obj => obj._isReadonly, set: (obj, value) => { obj._isReadonly = value; } }, metadata: _metadata }, __isReadonly_initializers, __isReadonly_extraInitializers);
|
|
73
77
|
__esDecorate(this, null, __richTextElement_decorators, { kind: "accessor", name: "_richTextElement", static: false, private: false, access: { has: obj => "_richTextElement" in obj, get: obj => obj._richTextElement, set: (obj, value) => { obj._richTextElement = value; } }, metadata: _metadata }, __richTextElement_initializers, __richTextElement_extraInitializers);
|
|
74
78
|
__esDecorate(this, null, _doc_decorators, { kind: "accessor", name: "doc", static: false, private: false, access: { has: obj => "doc" in obj, get: obj => obj.doc, set: (obj, value) => { obj.doc = value; } }, metadata: _metadata }, _doc_initializers, _doc_extraInitializers);
|
|
75
79
|
__esDecorate(this, null, _wrapText_decorators, { kind: "accessor", name: "wrapText", static: false, private: false, access: { has: obj => "wrapText" in obj, get: obj => obj.wrapText, set: (obj, value) => { obj.wrapText = value; } }, metadata: _metadata }, _wrapText_initializers, _wrapText_extraInitializers);
|
|
80
|
+
__esDecorate(this, null, _bodyBlockId_decorators, { kind: "accessor", name: "bodyBlockId", static: false, private: false, access: { has: obj => "bodyBlockId" in obj, get: obj => obj.bodyBlockId, set: (obj, value) => { obj.bodyBlockId = value; } }, metadata: _metadata }, _bodyBlockId_initializers, _bodyBlockId_extraInitializers);
|
|
76
81
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
77
82
|
}
|
|
78
83
|
static { this.styles = css `
|
|
@@ -162,6 +167,19 @@ let DocTitle = (() => {
|
|
|
162
167
|
const noteId = this.doc.addBlock('affine:note', {}, this._rootModel, 0);
|
|
163
168
|
return this.doc.getBlock(noteId)?.model;
|
|
164
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Leaves the title for `bodyBlockId`: the title loses the caret (its text
|
|
172
|
+
* is already stored, so that is all "validating" it means), then the block
|
|
173
|
+
* takes the caret where it can, through its `focusFirstCell` (a database
|
|
174
|
+
* block's: the first cell of a table or kanban view). A block without one,
|
|
175
|
+
* or a view without cells, keeps nothing focused. Writes nothing.
|
|
176
|
+
*/
|
|
177
|
+
_leaveForBodyBlock(std, blockId) {
|
|
178
|
+
this.inlineEditor?.setInlineRange(null);
|
|
179
|
+
this.inlineEditor?.rootElement?.blur();
|
|
180
|
+
const block = std.view.getBlock(blockId);
|
|
181
|
+
block?.focusFirstCell?.();
|
|
182
|
+
}
|
|
165
183
|
get _std() {
|
|
166
184
|
return this._viewport?.querySelector('editor-host')?.std;
|
|
167
185
|
}
|
|
@@ -275,6 +293,18 @@ let DocTitle = (() => {
|
|
|
275
293
|
#wrapText_accessor_storage;
|
|
276
294
|
get wrapText() { return this.#wrapText_accessor_storage; }
|
|
277
295
|
set wrapText(value) { this.#wrapText_accessor_storage = value; }
|
|
296
|
+
#bodyBlockId_accessor_storage;
|
|
297
|
+
/**
|
|
298
|
+
* The block that is the page's body, when the document's note is not (a
|
|
299
|
+
* database's full page, ADR 0035 B13: the document holds the database
|
|
300
|
+
* block and its schema blocks in a note the page never draws). Set, the
|
|
301
|
+
* title has no body of its own: Enter and ArrowDown leave the title for
|
|
302
|
+
* this block and never add or focus a paragraph, so nothing is ever
|
|
303
|
+
* written to the note. Unset (the default), Enter splits the title into a
|
|
304
|
+
* first paragraph and ArrowDown focuses or creates one, as in 0.48.
|
|
305
|
+
*/
|
|
306
|
+
get bodyBlockId() { return this.#bodyBlockId_accessor_storage; }
|
|
307
|
+
set bodyBlockId(value) { this.#bodyBlockId_accessor_storage = value; }
|
|
278
308
|
constructor() {
|
|
279
309
|
super(...arguments);
|
|
280
310
|
this._onTitleKeyDown = (event) => {
|
|
@@ -282,6 +312,14 @@ let DocTitle = (() => {
|
|
|
282
312
|
return;
|
|
283
313
|
if (!this._std)
|
|
284
314
|
return;
|
|
315
|
+
if (this.bodyBlockId !== undefined &&
|
|
316
|
+
(event.key === 'Enter' || event.key === 'ArrowDown')) {
|
|
317
|
+
this._std.event.active = true;
|
|
318
|
+
event.preventDefault();
|
|
319
|
+
event.stopPropagation();
|
|
320
|
+
this._leaveForBodyBlock(this._std, this.bodyBlockId);
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
285
323
|
if (event.key === 'Enter') {
|
|
286
324
|
this._std.event.active = true;
|
|
287
325
|
event.preventDefault();
|
|
@@ -331,7 +369,8 @@ let DocTitle = (() => {
|
|
|
331
369
|
this.#_richTextElement_accessor_storage = (__runInitializers(this, __isReadonly_extraInitializers), __runInitializers(this, __richTextElement_initializers, void 0));
|
|
332
370
|
this.#doc_accessor_storage = (__runInitializers(this, __richTextElement_extraInitializers), __runInitializers(this, _doc_initializers, void 0));
|
|
333
371
|
this.#wrapText_accessor_storage = (__runInitializers(this, _doc_extraInitializers), __runInitializers(this, _wrapText_initializers, true));
|
|
334
|
-
__runInitializers(this, _wrapText_extraInitializers);
|
|
372
|
+
this.#bodyBlockId_accessor_storage = (__runInitializers(this, _wrapText_extraInitializers), __runInitializers(this, _bodyBlockId_initializers, undefined));
|
|
373
|
+
__runInitializers(this, _bodyBlockId_extraInitializers);
|
|
335
374
|
}
|
|
336
375
|
};
|
|
337
376
|
})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { DocTitle } from './doc-title.js';
|
|
2
|
-
export {
|
|
2
|
+
export { type ChipTag, chipValueView, type ChipValueView, formatPropertyValue, isPropertyValueEmpty, } from './title-band/format.js';
|
|
3
3
|
export { LABRE_TITLE_BAND, TitleBand } from './title-band/title-band.js';
|
|
4
4
|
export { getDocTitleByEditorHost } from './utils.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { DocTitle } from './doc-title.js';
|
|
2
|
-
export {
|
|
2
|
+
export { chipValueView, formatPropertyValue, isPropertyValueEmpty, } from './title-band/format.js';
|
|
3
3
|
export { LABRE_TITLE_BAND, TitleBand } from './title-band/title-band.js';
|
|
4
4
|
export { getDocTitleByEditorHost } from './utils.js';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { TitleBandProperty } from '../../affine-shared/services/index.js';
|
|
2
|
+
import { type PropertyMetaConfig } from '../../data-view/index.js';
|
|
3
|
+
/** The data-view cell type that draws a band property of `type`, if any. */
|
|
4
|
+
export declare function bandCellType(type: string): string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* The cell's meta: one a package above registered for that cell type (the
|
|
7
|
+
* database block's `link`), else this package's preset. Without its
|
|
8
|
+
* registration a link is drawn by the `text` cell.
|
|
9
|
+
*/
|
|
10
|
+
export declare function bandCellMeta(type: string, registered: (cellType: string) => PropertyMetaConfig | null): PropertyMetaConfig | null;
|
|
11
|
+
export declare function isBandReadonlyType(type: string): boolean;
|
|
12
|
+
/** The value in the raw shape of the cell type `cellType` reads. */
|
|
13
|
+
export declare function bandCellValue(cellType: string, value: unknown): unknown;
|
|
14
|
+
/** The property's config as the cell reads it: a select's tags, complete. */
|
|
15
|
+
export declare function bandCellData(cellType: string, property: TitleBandProperty): Record<string, unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* What the band writes back for a value a cell commits: `null` for an empty
|
|
18
|
+
* one (the seam's "clear"), the value itself otherwise.
|
|
19
|
+
*/
|
|
20
|
+
export declare function bandWriteValue(value: unknown): unknown;
|
|
21
|
+
/** Whether a committed value is the one the chip already shows. */
|
|
22
|
+
export declare function sameBandValue(cellType: string, current: unknown, next: unknown): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether a chip's tag menu creates and renames options (product owner,
|
|
25
|
+
* 2026-10-14): a select or multi-select whose host takes a definition write
|
|
26
|
+
* (`setData`) and says so for this property (`dataWritable: true`). Anything
|
|
27
|
+
* else keeps its options fixed, the 0.48 band. A read-only chip opens no
|
|
28
|
+
* editor whatever this says.
|
|
29
|
+
*/
|
|
30
|
+
export declare function bandOptionsWritable(cellType: string, property: TitleBandProperty, hasSetData: boolean): boolean;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { selectOptionColors, } from '../../data-view/index.js';
|
|
2
|
+
import { propertyPresets } from '../../data-view/property-presets/index.js';
|
|
3
|
+
import { chipOptions } from './format.js';
|
|
4
|
+
/**
|
|
5
|
+
* Which data-view cell draws a band property, and the value and config that
|
|
6
|
+
* cell is handed (ADR 0035 §11, amended 2026-10-13: the chips are the table's
|
|
7
|
+
* own cells).
|
|
8
|
+
*
|
|
9
|
+
* The band speaks the data-view types (§9d), plus the aliases a host's sheet
|
|
10
|
+
* holds whose shape a preset already reads: a URL is the table's `link` cell,
|
|
11
|
+
* the text-like types the `text` cell, the time stamps a read-only `date`.
|
|
12
|
+
* A type with no cell here (`relation`, `image`, an invented one) keeps the
|
|
13
|
+
* band's plain-text reading and opens the properties panel instead.
|
|
14
|
+
*
|
|
15
|
+
* The host's JSON is never trusted to have the preset's shape: a renderer
|
|
16
|
+
* that meets a string where it maps an array throws mid-render, so each value
|
|
17
|
+
* is narrowed to its cell's raw shape, and anything else reads as empty.
|
|
18
|
+
*/
|
|
19
|
+
const CELL_TYPES = Object.assign(Object.create(null), {
|
|
20
|
+
checkbox: 'checkbox',
|
|
21
|
+
select: 'select',
|
|
22
|
+
'multi-select': 'multi-select',
|
|
23
|
+
date: 'date',
|
|
24
|
+
'created-time': 'date',
|
|
25
|
+
'modified-time': 'date',
|
|
26
|
+
number: 'number',
|
|
27
|
+
progress: 'progress',
|
|
28
|
+
text: 'text',
|
|
29
|
+
'rich-text': 'text',
|
|
30
|
+
title: 'text',
|
|
31
|
+
email: 'text',
|
|
32
|
+
phone: 'text',
|
|
33
|
+
link: 'link',
|
|
34
|
+
url: 'link',
|
|
35
|
+
});
|
|
36
|
+
/** Drawn by their cell, never edited from the band. */
|
|
37
|
+
const READ_ONLY_TYPES = new Set(['created-time', 'modified-time']);
|
|
38
|
+
const PRESETS = new Map([
|
|
39
|
+
propertyPresets.checkboxPropertyConfig,
|
|
40
|
+
propertyPresets.datePropertyConfig,
|
|
41
|
+
propertyPresets.multiSelectPropertyConfig,
|
|
42
|
+
propertyPresets.numberPropertyConfig,
|
|
43
|
+
propertyPresets.progressPropertyConfig,
|
|
44
|
+
propertyPresets.selectPropertyConfig,
|
|
45
|
+
propertyPresets.textPropertyConfig,
|
|
46
|
+
].map(meta => [meta.type, meta]));
|
|
47
|
+
const DEFAULT_TAG_COLOR = selectOptionColors.at(-1)?.color ?? '';
|
|
48
|
+
/** The data-view cell type that draws a band property of `type`, if any. */
|
|
49
|
+
export function bandCellType(type) {
|
|
50
|
+
return CELL_TYPES[type];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The cell's meta: one a package above registered for that cell type (the
|
|
54
|
+
* database block's `link`), else this package's preset. Without its
|
|
55
|
+
* registration a link is drawn by the `text` cell.
|
|
56
|
+
*/
|
|
57
|
+
export function bandCellMeta(type, registered) {
|
|
58
|
+
const cellType = bandCellType(type);
|
|
59
|
+
if (!cellType)
|
|
60
|
+
return null;
|
|
61
|
+
return (registered(cellType) ??
|
|
62
|
+
PRESETS.get(cellType) ??
|
|
63
|
+
(cellType === 'link' ? (PRESETS.get('text') ?? null) : null));
|
|
64
|
+
}
|
|
65
|
+
export function isBandReadonlyType(type) {
|
|
66
|
+
return READ_ONLY_TYPES.has(type);
|
|
67
|
+
}
|
|
68
|
+
const isFiniteNumber = (value) => typeof value === 'number' && Number.isFinite(value);
|
|
69
|
+
/** The value in the raw shape of the cell type `cellType` reads. */
|
|
70
|
+
export function bandCellValue(cellType, value) {
|
|
71
|
+
switch (cellType) {
|
|
72
|
+
case 'checkbox':
|
|
73
|
+
return value === true;
|
|
74
|
+
case 'select':
|
|
75
|
+
return typeof value === 'string' && value !== '' ? value : undefined;
|
|
76
|
+
case 'multi-select':
|
|
77
|
+
return Array.isArray(value)
|
|
78
|
+
? value.filter((id) => typeof id === 'string')
|
|
79
|
+
: undefined;
|
|
80
|
+
case 'date':
|
|
81
|
+
case 'number':
|
|
82
|
+
case 'progress':
|
|
83
|
+
return isFiniteNumber(value) ? value : undefined;
|
|
84
|
+
default:
|
|
85
|
+
if (typeof value === 'string')
|
|
86
|
+
return value;
|
|
87
|
+
if (isFiniteNumber(value))
|
|
88
|
+
return String(value);
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** The property's config as the cell reads it: a select's tags, complete. */
|
|
93
|
+
export function bandCellData(cellType, property) {
|
|
94
|
+
if (cellType !== 'select' && cellType !== 'multi-select') {
|
|
95
|
+
return property.data;
|
|
96
|
+
}
|
|
97
|
+
const options = chipOptions(property).map(tag => ({
|
|
98
|
+
id: tag.id,
|
|
99
|
+
value: tag.label,
|
|
100
|
+
color: tag.color ?? DEFAULT_TAG_COLOR,
|
|
101
|
+
}));
|
|
102
|
+
return { ...property.data, options };
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* What the band writes back for a value a cell commits: `null` for an empty
|
|
106
|
+
* one (the seam's "clear"), the value itself otherwise.
|
|
107
|
+
*/
|
|
108
|
+
export function bandWriteValue(value) {
|
|
109
|
+
if (value === undefined)
|
|
110
|
+
return null;
|
|
111
|
+
if (typeof value === 'string' && value.trim() === '')
|
|
112
|
+
return null;
|
|
113
|
+
if (typeof value === 'number' && Number.isNaN(value))
|
|
114
|
+
return null;
|
|
115
|
+
return value;
|
|
116
|
+
}
|
|
117
|
+
/** Whether a committed value is the one the chip already shows. */
|
|
118
|
+
export function sameBandValue(cellType, current, next) {
|
|
119
|
+
const a = bandWriteValue(bandCellValue(cellType, current));
|
|
120
|
+
const b = bandWriteValue(next);
|
|
121
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
122
|
+
return a.length === b.length && a.every((item, i) => item === b[i]);
|
|
123
|
+
}
|
|
124
|
+
return a === b;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Whether a chip's tag menu creates and renames options (product owner,
|
|
128
|
+
* 2026-10-14): a select or multi-select whose host takes a definition write
|
|
129
|
+
* (`setData`) and says so for this property (`dataWritable: true`). Anything
|
|
130
|
+
* else keeps its options fixed, the 0.48 band. A read-only chip opens no
|
|
131
|
+
* editor whatever this says.
|
|
132
|
+
*/
|
|
133
|
+
export function bandOptionsWritable(cellType, property, hasSetData) {
|
|
134
|
+
return (hasSetData &&
|
|
135
|
+
property.dataWritable === true &&
|
|
136
|
+
(cellType === 'select' || cellType === 'multi-select'));
|
|
137
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { TitleBandProperty } from '../../affine-shared/services/index.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* A property's value as one line of text — pure, render-free, so a host's own
|
|
4
|
+
* properties panel can show what a chip reads (`formatPropertyValue`,
|
|
5
|
+
* re-exported by `@labre/affine/host-panels`), and the band can still read
|
|
6
|
+
* a type no data-view cell draws (`relation`, an unknown one).
|
|
7
7
|
*
|
|
8
8
|
* The value is the JSON a data-view cell of `type` holds (ADR 0035 §9d), and
|
|
9
9
|
* the shapes below are the data-view presets' own: an option id for `select`,
|
|
@@ -11,12 +11,9 @@ import type { TitleBandProperty } from '../../affine-shared/services/index.js';
|
|
|
11
11
|
* formatted with the number preset's options, so a chip and a database cell
|
|
12
12
|
* read the same.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* band does not know: it is drawn as plain text and opens no editor. The
|
|
18
|
-
* upgrade path is a hosted data source for the page's sheet once
|
|
19
|
-
* `HostedDataSourceBase` exists (ADR 0035 §7, issue B1).
|
|
14
|
+
* The chips themselves no longer read this: each value is drawn and edited by
|
|
15
|
+
* the data-view cell of its type (`./band-cell.ts`, ADR 0035 §11 amended
|
|
16
|
+
* 2026-10-13). This text is the host panels' reading and the band's fallback.
|
|
20
17
|
*/
|
|
21
18
|
/** A select option as a data-view `select` / `multi-select` holds it. */
|
|
22
19
|
export interface ChipTag {
|
|
@@ -37,8 +34,6 @@ export type ChipValueView = {
|
|
|
37
34
|
kind: 'tags';
|
|
38
35
|
tags: ChipTag[];
|
|
39
36
|
};
|
|
40
|
-
/** The editor a click on a chip opens; `none` for a type the band cannot edit. */
|
|
41
|
-
export type ChipEditorKind = 'toggle' | 'select' | 'multi-select' | 'date' | 'number' | 'text' | 'none';
|
|
42
37
|
/**
|
|
43
38
|
* The number preset's formats (`data-view/…/number/utils/formatter.ts`),
|
|
44
39
|
* restated rather than imported: the preset formats with
|
|
@@ -60,10 +55,3 @@ export declare function chipValueView(property: TitleBandProperty, locale: strin
|
|
|
60
55
|
* mark, not a word, so a host draws its own from `property.value`.
|
|
61
56
|
*/
|
|
62
57
|
export declare function formatPropertyValue(property: TitleBandProperty, locale?: string): string;
|
|
63
|
-
/**
|
|
64
|
-
* A number typed in a chip's editor: blanks dropped, a decimal comma read as
|
|
65
|
-
* a point. `NaN` for anything else, which the band writes as `null`.
|
|
66
|
-
*/
|
|
67
|
-
export declare function parseChipNumber(text: string): number;
|
|
68
|
-
/** The editor a click on this property's chip opens. */
|
|
69
|
-
export declare function chipEditorKind(property: TitleBandProperty): ChipEditorKind;
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
const TEXT_TYPES = new Set([
|
|
2
|
-
'text',
|
|
3
|
-
'rich-text',
|
|
4
|
-
'title',
|
|
5
|
-
'url',
|
|
6
|
-
'link',
|
|
7
|
-
'email',
|
|
8
|
-
'phone',
|
|
9
|
-
]);
|
|
10
1
|
const DATE_TYPES = new Set(['date', 'created-time', 'modified-time']);
|
|
11
2
|
const currency = (code) => ({
|
|
12
3
|
style: 'currency',
|
|
@@ -151,32 +142,3 @@ export function formatPropertyValue(property, locale = 'en-US') {
|
|
|
151
142
|
return '';
|
|
152
143
|
}
|
|
153
144
|
}
|
|
154
|
-
/**
|
|
155
|
-
* A number typed in a chip's editor: blanks dropped, a decimal comma read as
|
|
156
|
-
* a point. `NaN` for anything else, which the band writes as `null`.
|
|
157
|
-
*/
|
|
158
|
-
export function parseChipNumber(text) {
|
|
159
|
-
const compact = text.replace(/\s/g, '');
|
|
160
|
-
if (compact === '')
|
|
161
|
-
return NaN;
|
|
162
|
-
return Number(compact.replace(',', '.'));
|
|
163
|
-
}
|
|
164
|
-
/** The editor a click on this property's chip opens. */
|
|
165
|
-
export function chipEditorKind(property) {
|
|
166
|
-
if (property.readonly)
|
|
167
|
-
return 'none';
|
|
168
|
-
const { type } = property;
|
|
169
|
-
if (type === 'checkbox')
|
|
170
|
-
return 'toggle';
|
|
171
|
-
if (type === 'select')
|
|
172
|
-
return 'select';
|
|
173
|
-
if (type === 'multi-select')
|
|
174
|
-
return 'multi-select';
|
|
175
|
-
if (type === 'date')
|
|
176
|
-
return 'date';
|
|
177
|
-
if (type === 'number' || type === 'progress')
|
|
178
|
-
return 'number';
|
|
179
|
-
if (TEXT_TYPES.has(type))
|
|
180
|
-
return 'text';
|
|
181
|
-
return 'none';
|
|
182
|
-
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BlockStdScope } from '../../std/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* "Show here" (labre ADR-0045 §7): insert a card of page `pageId` into the
|
|
4
|
+
* open document, so a child page the document held without showing becomes
|
|
5
|
+
* shown. The host computes the "Not shown" list; once the card exists, its
|
|
6
|
+
* own reading of the document drops the page from it. Nothing here knows a
|
|
7
|
+
* parent or a child: the card is an ordinary `affine:embed-linked-doc`,
|
|
8
|
+
* exactly what pasting a link to that page would make.
|
|
9
|
+
*
|
|
10
|
+
* - page view: at the end of the last note the page view shows (a new note
|
|
11
|
+
* when there is none);
|
|
12
|
+
* - canvas: centred in the visible part of the canvas, through the CRUD
|
|
13
|
+
* `addBlock`, which stamps the viewer's active layer (ADR 0031 §6), then
|
|
14
|
+
* selected so the reader sees what appeared.
|
|
15
|
+
*
|
|
16
|
+
* One gesture, one undo step (`captureSync`). A read-only document gets
|
|
17
|
+
* nothing. Returns the new card's id, or `null` when nothing was written.
|
|
18
|
+
*/
|
|
19
|
+
export declare function showPageHere(std: BlockStdScope, surface: 'page' | 'canvas', pageId: string): string | null;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { EdgelessCRUDIdentifier } from '../../affine-block-surface/index.js';
|
|
2
|
+
import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../../affine-shared/consts/index.js';
|
|
3
|
+
import { TelemetryProvider } from '../../affine-shared/services/index.js';
|
|
4
|
+
import { getLastNoteBlock } from '../../affine-shared/utils/index.js';
|
|
5
|
+
import { Bound } from '../../global/gfx/index.js';
|
|
6
|
+
import { GfxControllerIdentifier } from '../../std/gfx/index.js';
|
|
7
|
+
const LINKED_DOC = 'affine:embed-linked-doc';
|
|
8
|
+
/** The canvas card's style, the one "Linked doc" inserts on the canvas. */
|
|
9
|
+
const CANVAS_STYLE = 'vertical';
|
|
10
|
+
/**
|
|
11
|
+
* "Show here" (labre ADR-0045 §7): insert a card of page `pageId` into the
|
|
12
|
+
* open document, so a child page the document held without showing becomes
|
|
13
|
+
* shown. The host computes the "Not shown" list; once the card exists, its
|
|
14
|
+
* own reading of the document drops the page from it. Nothing here knows a
|
|
15
|
+
* parent or a child: the card is an ordinary `affine:embed-linked-doc`,
|
|
16
|
+
* exactly what pasting a link to that page would make.
|
|
17
|
+
*
|
|
18
|
+
* - page view: at the end of the last note the page view shows (a new note
|
|
19
|
+
* when there is none);
|
|
20
|
+
* - canvas: centred in the visible part of the canvas, through the CRUD
|
|
21
|
+
* `addBlock`, which stamps the viewer's active layer (ADR 0031 §6), then
|
|
22
|
+
* selected so the reader sees what appeared.
|
|
23
|
+
*
|
|
24
|
+
* One gesture, one undo step (`captureSync`). A read-only document gets
|
|
25
|
+
* nothing. Returns the new card's id, or `null` when nothing was written.
|
|
26
|
+
*/
|
|
27
|
+
export function showPageHere(std, surface, pageId) {
|
|
28
|
+
const { store } = std;
|
|
29
|
+
if (store.readonly || !store.root || !pageId)
|
|
30
|
+
return null;
|
|
31
|
+
store.captureSync();
|
|
32
|
+
const id = surface === 'canvas'
|
|
33
|
+
? insertOnCanvas(std, pageId)
|
|
34
|
+
: insertInPage(std, pageId);
|
|
35
|
+
if (id) {
|
|
36
|
+
std.getOptional(TelemetryProvider)?.track('BlockCreated', {
|
|
37
|
+
blockType: LINKED_DOC,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return id;
|
|
41
|
+
}
|
|
42
|
+
function insertInPage(std, pageId) {
|
|
43
|
+
const { store } = std;
|
|
44
|
+
const root = store.root;
|
|
45
|
+
if (!root)
|
|
46
|
+
return null;
|
|
47
|
+
const noteId = getLastNoteBlock(store)?.id ?? store.addBlock('affine:note', {}, root.id);
|
|
48
|
+
return store.addBlock(LINKED_DOC, { pageId }, noteId);
|
|
49
|
+
}
|
|
50
|
+
function insertOnCanvas(std, pageId) {
|
|
51
|
+
const gfx = std.get(GfxControllerIdentifier);
|
|
52
|
+
const surface = gfx.surface;
|
|
53
|
+
if (!surface)
|
|
54
|
+
return null;
|
|
55
|
+
const xywh = Bound.fromCenter([gfx.viewport.centerX, gfx.viewport.centerY], EMBED_CARD_WIDTH[CANVAS_STYLE], EMBED_CARD_HEIGHT[CANVAS_STYLE]).serialize();
|
|
56
|
+
const id = std
|
|
57
|
+
.get(EdgelessCRUDIdentifier)
|
|
58
|
+
.addBlock(LINKED_DOC, { pageId, xywh, style: CANVAS_STYLE }, surface);
|
|
59
|
+
gfx.selection.set({ elements: [id], editing: false });
|
|
60
|
+
return id;
|
|
61
|
+
}
|
|
@@ -14,40 +14,55 @@ declare const TitleBand_base: typeof ShadowlessElement & import("../../global/ut
|
|
|
14
14
|
*
|
|
15
15
|
* Fed by `TitleBandProvider` alone (§9d): no provider, nothing at all. The
|
|
16
16
|
* chips are the sheet's visible properties in the host's order, an empty one
|
|
17
|
-
* included (REQ-PR-1)
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
17
|
+
* included (REQ-PR-1). Each value is drawn and edited by the cell the inline
|
|
18
|
+
* table mounts for its data-view type (`<dv-standalone-cell>`, ADR 0035
|
|
19
|
+
* §11 amended 2026-10-13): the checkbox, the tag menu of a select, the date
|
|
20
|
+
* picker, the number, text and link inputs, with the table's own styles. The
|
|
21
|
+
* value the cell commits goes back through `set`, the chip shows pending
|
|
22
|
+
* until the host settles it, and a type with no cell keeps a plain-text
|
|
23
|
+
* reading that opens the properties panel. The band never applies a value, and writes to
|
|
24
|
+
* the document only the card "Show here" inserts. The "+" is drawn when the
|
|
25
|
+
* host passes `add`; the panel button when a `PropertiesPanelProvider` is
|
|
26
|
+
* registered. The "Not shown on this page" row is drawn in both views
|
|
27
|
+
* from the host's `notShown$` (ADR 0035 §9d, amended 2026-10-13): each page
|
|
28
|
+
* opens through the linked-document path, and "Show here" inserts a card of
|
|
29
|
+
* it into this document; the host then drops the page from its list.
|
|
23
30
|
*/
|
|
24
31
|
export declare class TitleBand extends TitleBand_base {
|
|
25
32
|
static styles: import("lit").CSSResult;
|
|
26
33
|
private _sources;
|
|
27
|
-
/** The editor menu open now, put away with the band. */
|
|
28
|
-
private _menu;
|
|
29
|
-
private _pop;
|
|
30
34
|
/** Collapse state when the host does not remember one. */
|
|
31
35
|
private readonly _localCollapsed$;
|
|
32
36
|
/** Property ids whose `set` has not settled yet. */
|
|
33
37
|
private readonly _pending$;
|
|
34
38
|
/** Read inside `render` it subscribes, through `SignalWatcher`. */
|
|
35
39
|
private get _readonly();
|
|
40
|
+
/** The table's own flags, so a number reads as it does in a cell. */
|
|
41
|
+
private readonly _featureFlags$;
|
|
36
42
|
private get _locale();
|
|
37
43
|
private _t;
|
|
38
44
|
private _getSources;
|
|
39
45
|
private _isCollapsed;
|
|
40
46
|
private _setCollapsed;
|
|
41
47
|
private _write;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
private
|
|
47
|
-
|
|
48
|
-
private
|
|
48
|
+
/**
|
|
49
|
+
* A definition a select's tag menu commits (a created or renamed option):
|
|
50
|
+
* handed to the host's `setData`, never applied here.
|
|
51
|
+
*/
|
|
52
|
+
private _writeData;
|
|
53
|
+
/** A value a cell commits: unchanged, nothing is written. */
|
|
54
|
+
private _commit;
|
|
55
|
+
/** Neither the property nor the document can be written, or the type. */
|
|
56
|
+
private _isReadonlyChip;
|
|
57
|
+
/**
|
|
58
|
+
* The cell that draws `prop`, built once per property and type: its value,
|
|
59
|
+
* name and config are read from the sheet, so a new sheet updates the cell
|
|
60
|
+
* in place and an editor open in it stays open.
|
|
61
|
+
*/
|
|
62
|
+
private _cellFor;
|
|
49
63
|
private readonly _openPanel;
|
|
50
|
-
private
|
|
64
|
+
private readonly _onChip;
|
|
65
|
+
private _renderFallback;
|
|
51
66
|
private _renderChip;
|
|
52
67
|
private _renderTools;
|
|
53
68
|
private _renderSheet;
|
|
@@ -56,7 +71,7 @@ export declare class TitleBand extends TitleBand_base {
|
|
|
56
71
|
render(): TemplateResult<1> | typeof nothing;
|
|
57
72
|
accessor std: BlockStdScope | null;
|
|
58
73
|
accessor docId: string;
|
|
59
|
-
/** Where the band is drawn
|
|
74
|
+
/** Where the band is drawn: where "Show here" puts the card. */
|
|
60
75
|
accessor surface: 'page' | 'canvas';
|
|
61
76
|
}
|
|
62
77
|
export {};
|