@formicoidea/labre-core 0.60.0 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/architecture/code.c4 +28 -23
- package/architecture/likec4.config.json +3 -3
- package/dist/_pkgs/affine-block-attachment/asset-picker.d.ts +8 -0
- package/dist/_pkgs/affine-block-attachment/asset-picker.js +25 -1
- package/dist/_pkgs/affine-block-attachment/attachment-block.js +9 -7
- package/dist/_pkgs/affine-block-database/database-block.js +4 -5
- package/dist/_pkgs/affine-block-database/service/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-database/service/index.js +1 -0
- package/dist/_pkgs/affine-block-database/service/initial-view.d.ts +33 -0
- package/dist/_pkgs/affine-block-database/service/initial-view.js +20 -0
- package/dist/_pkgs/affine-block-database/utils/current-view.d.ts +7 -0
- package/dist/_pkgs/affine-block-database/utils/current-view.js +14 -0
- package/dist/_pkgs/affine-block-embed/common/render-linked-doc.js +2 -0
- package/dist/_pkgs/affine-block-embed-doc/common/child-card.d.ts +25 -0
- package/dist/_pkgs/affine-block-embed-doc/common/child-card.js +27 -0
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/commands/insert-embed-linked-doc.js +6 -1
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/new-doc.js +2 -2
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/embed-linked-doc-block.js +2 -6
- package/dist/_pkgs/affine-block-embed-doc/embed-synced-doc-block/embed-synced-doc-block.js +2 -3
- package/dist/_pkgs/affine-block-embed-doc/page-drop/page-drop.js +3 -3
- package/dist/_pkgs/affine-block-surface/extensions/reading-toolbar.js +12 -12
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/highlight-duotone-icon.js +8 -8
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/text-duotone-icon.js +11 -11
- package/dist/_pkgs/affine-components/icons/loading.d.ts +6 -0
- package/dist/_pkgs/affine-components/icons/loading.js +16 -12
- package/dist/_pkgs/affine-fragment-doc-title/title-band/show-here.js +2 -2
- package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.d.ts +8 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.js +35 -13
- package/dist/_pkgs/affine-fragment-doc-title/translations.d.ts +1 -1
- package/dist/_pkgs/affine-fragment-doc-title/translations.js +1 -1
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/basket-elements.d.ts +12 -0
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/basket-elements.js +44 -5
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/senior-tool.d.ts +3 -2
- package/dist/_pkgs/affine-gfx-mindmap/toolbar/senior-tool.js +3 -2
- package/dist/_pkgs/affine-gfx-template/builtin/slides/build.js +10 -10
- package/dist/_pkgs/affine-gfx-template/builtin/slides/consts.d.ts +48 -64
- package/dist/_pkgs/affine-gfx-template/builtin/slides/consts.js +24 -21
- package/dist/_pkgs/affine-gfx-template/builtin/slides/masks.d.ts +1 -2
- package/dist/_pkgs/affine-gfx-template/builtin/slides/masks.js +0 -34
- package/dist/_pkgs/affine-inline-reference/reference-node/configs/toolbar.js +2 -1
- package/dist/_pkgs/affine-shared/consts/index.d.ts +9 -0
- package/dist/_pkgs/affine-shared/consts/index.js +9 -0
- package/dist/_pkgs/affine-shared/services/asset-picker-service.d.ts +7 -6
- package/dist/_pkgs/affine-shared/services/asset-picker-service.js +5 -5
- package/dist/_pkgs/affine-shared/services/title-band-service.d.ts +19 -0
- package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/index.js +26 -26
- package/dist/_pkgs/affine-widget-keyboard-toolbar/icons.js +98 -98
- package/dist/_pkgs/affine-widget-page-dragging-area/index.js +10 -10
- package/dist/_pkgs/affine-widget-viewport-overlay/index.js +13 -13
- package/dist/_pkgs/data-view/core/component/cell-status/cell-status-css.d.ts +1 -1
- package/dist/_pkgs/data-view/core/component/cell-status/cell-status-css.js +10 -10
- package/dist/_pkgs/data-view/core/component/cell-status/cell-status.d.ts +1 -1
- package/dist/_pkgs/data-view/core/component/cell-status/cell-status.js +7 -5
- package/dist/_pkgs/data-view/core/utils/menu-title.js +17 -17
- package/dist/_pkgs/data-view/property-presets/number/cell-renderer.d.ts +18 -0
- package/dist/_pkgs/data-view/property-presets/number/cell-renderer.js +51 -10
- package/dist/_pkgs/data-view/property-presets/text/cell-renderer.d.ts +23 -1
- package/dist/_pkgs/data-view/property-presets/text/cell-renderer.js +56 -15
- package/dist/_pkgs/data-view/property-presets/typing-commit.d.ts +16 -0
- package/dist/_pkgs/data-view/property-presets/typing-commit.js +27 -0
- package/dist/_pkgs/data-view/view-presets/list/list-view.js +1 -1
- package/package.json +1 -1
package/architecture/code.c4
CHANGED
|
@@ -565,7 +565,7 @@ model {
|
|
|
565
565
|
link https://github.com/formicoidea/blocksuite-labre/tree/blocksuite-labre-main/packages/affine/blocks/database
|
|
566
566
|
metadata {
|
|
567
567
|
path 'packages/affine/blocks/database'
|
|
568
|
-
files '
|
|
568
|
+
files '61'
|
|
569
569
|
}
|
|
570
570
|
adapters = folder 'adapters/' {
|
|
571
571
|
link https://github.com/formicoidea/blocksuite-labre/tree/blocksuite-labre-main/packages/affine/blocks/database/src/adapters
|
|
@@ -613,7 +613,7 @@ model {
|
|
|
613
613
|
link https://github.com/formicoidea/blocksuite-labre/tree/blocksuite-labre-main/packages/affine/blocks/database/src/service
|
|
614
614
|
metadata {
|
|
615
615
|
path 'packages/affine/blocks/database/src/service'
|
|
616
|
-
files '
|
|
616
|
+
files '5'
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
src = folder 'src/' {
|
|
@@ -761,13 +761,13 @@ model {
|
|
|
761
761
|
link https://github.com/formicoidea/blocksuite-labre/tree/blocksuite-labre-main/packages/affine/blocks/embed-doc
|
|
762
762
|
metadata {
|
|
763
763
|
path 'packages/affine/blocks/embed-doc'
|
|
764
|
-
files '
|
|
764
|
+
files '46'
|
|
765
765
|
}
|
|
766
766
|
common = folder 'common/' {
|
|
767
767
|
link https://github.com/formicoidea/blocksuite-labre/tree/blocksuite-labre-main/packages/affine/blocks/embed-doc/src/common
|
|
768
768
|
metadata {
|
|
769
769
|
path 'packages/affine/blocks/embed-doc/src/common'
|
|
770
|
-
files '
|
|
770
|
+
files '3'
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
773
|
embed-linked-doc-block = folder 'embed-linked-doc-block/' {
|
|
@@ -1525,7 +1525,7 @@ model {
|
|
|
1525
1525
|
link https://github.com/formicoidea/blocksuite-labre/tree/blocksuite-labre-main/packages/affine/data-view
|
|
1526
1526
|
metadata {
|
|
1527
1527
|
path 'packages/affine/data-view'
|
|
1528
|
-
files '
|
|
1528
|
+
files '349'
|
|
1529
1529
|
}
|
|
1530
1530
|
core = folder 'core/' {
|
|
1531
1531
|
link https://github.com/formicoidea/blocksuite-labre/tree/blocksuite-labre-main/packages/affine/data-view/src/core
|
|
@@ -1538,7 +1538,7 @@ model {
|
|
|
1538
1538
|
link https://github.com/formicoidea/blocksuite-labre/tree/blocksuite-labre-main/packages/affine/data-view/src/property-presets
|
|
1539
1539
|
metadata {
|
|
1540
1540
|
path 'packages/affine/data-view/src/property-presets'
|
|
1541
|
-
files '
|
|
1541
|
+
files '31'
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
1544
1544
|
src = folder 'src/' {
|
|
@@ -3560,9 +3560,9 @@ model {
|
|
|
3560
3560
|
features.blocks.database -[uses]-> features.shared '39 imports, 7 type-only'
|
|
3561
3561
|
features.blocks.database -[uses]-> features.widgets.drag-handle '1 import'
|
|
3562
3562
|
features.blocks.database -[uses]-> features.widgets.slash-menu '2 imports, 1 type-only'
|
|
3563
|
-
features.blocks.database -[uses]-> framework.global_ '
|
|
3563
|
+
features.blocks.database -[uses]-> framework.global_ '15 imports'
|
|
3564
3564
|
features.blocks.database -[uses]-> framework.std '17 imports, 7 type-only'
|
|
3565
|
-
features.blocks.database -[uses]-> framework.store '
|
|
3565
|
+
features.blocks.database -[uses]-> framework.store '22 imports, 14 type-only'
|
|
3566
3566
|
features.blocks.database -[uses]-> model_.model_ '19 imports, 11 type-only'
|
|
3567
3567
|
features.blocks.divider -[uses]-> features.components '1 import'
|
|
3568
3568
|
features.blocks.divider -[uses]-> features.ext-loader '2 imports'
|
|
@@ -3584,7 +3584,7 @@ model {
|
|
|
3584
3584
|
features.blocks.embed -[uses]-> features.blocks.surface '18 imports'
|
|
3585
3585
|
features.blocks.embed -[uses]-> features.components '18 imports'
|
|
3586
3586
|
features.blocks.embed -[uses]-> features.ext-loader '2 imports'
|
|
3587
|
-
features.blocks.embed -[uses]-> features.shared '
|
|
3587
|
+
features.blocks.embed -[uses]-> features.shared '90 imports, 5 type-only'
|
|
3588
3588
|
features.blocks.embed -[uses]-> features.widgets.slash-menu '10 imports, 5 type-only'
|
|
3589
3589
|
features.blocks.embed -[uses]-> framework.global_ '11 imports'
|
|
3590
3590
|
features.blocks.embed -[uses]-> framework.std '41 imports, 10 type-only'
|
|
@@ -3596,12 +3596,12 @@ model {
|
|
|
3596
3596
|
features.blocks.embed-doc -[uses]-> features.ext-loader '4 imports'
|
|
3597
3597
|
features.blocks.embed-doc -[uses]-> features.inlines.reference '2 imports'
|
|
3598
3598
|
features.blocks.embed-doc -[uses]-> features.rich-text '1 import'
|
|
3599
|
-
features.blocks.embed-doc -[uses]-> features.shared '
|
|
3599
|
+
features.blocks.embed-doc -[uses]-> features.shared '39 imports, 1 type-only'
|
|
3600
3600
|
features.blocks.embed-doc -[uses]-> features.widgets.slash-menu '1 import'
|
|
3601
3601
|
features.blocks.embed-doc -[uses]-> framework.global_ '10 imports'
|
|
3602
|
-
features.blocks.embed-doc -[uses]-> framework.std '
|
|
3602
|
+
features.blocks.embed-doc -[uses]-> framework.std '20 imports, 5 type-only'
|
|
3603
3603
|
features.blocks.embed-doc -[uses]-> framework.store '16 imports, 11 type-only'
|
|
3604
|
-
features.blocks.embed-doc -[uses]-> model_.model_ '
|
|
3604
|
+
features.blocks.embed-doc -[uses]-> model_.model_ '28 imports, 5 type-only'
|
|
3605
3605
|
features.blocks.frame -[uses]-> features.blocks.surface '12 imports'
|
|
3606
3606
|
features.blocks.frame -[uses]-> features.components '5 imports'
|
|
3607
3607
|
features.blocks.frame -[uses]-> features.ext-loader '2 imports'
|
|
@@ -3732,7 +3732,7 @@ model {
|
|
|
3732
3732
|
features.components -[uses]-> framework.store '8 imports, 7 type-only'
|
|
3733
3733
|
features.components -[uses]-> framework.sync '1 import, 1 type-only'
|
|
3734
3734
|
features.components -[uses]-> model_.model_ '16 imports, 5 type-only'
|
|
3735
|
-
features.data-view -[uses]-> features.components '
|
|
3735
|
+
features.data-view -[uses]-> features.components '73 imports, 3 type-only'
|
|
3736
3736
|
features.data-view -[uses]-> features.shared '84 imports, 42 type-only'
|
|
3737
3737
|
features.data-view -[uses]-> framework.global_ '95 imports, 5 type-only'
|
|
3738
3738
|
features.data-view -[uses]-> framework.std '81 imports, 10 type-only'
|
|
@@ -3763,6 +3763,7 @@ model {
|
|
|
3763
3763
|
features.fragments.adapter-panel -[uses]-> framework.std '2 imports, 2 type-only'
|
|
3764
3764
|
features.fragments.adapter-panel -[uses]-> framework.store '2 imports, 2 type-only'
|
|
3765
3765
|
features.fragments.doc-title -[uses]-> features.blocks.surface '1 import'
|
|
3766
|
+
features.fragments.doc-title -[uses]-> features.components '1 import'
|
|
3766
3767
|
features.fragments.doc-title -[uses]-> features.data-view '3 imports'
|
|
3767
3768
|
features.fragments.doc-title -[uses]-> features.ext-loader '1 import'
|
|
3768
3769
|
features.fragments.doc-title -[uses]-> features.inlines.reference '1 import'
|
|
@@ -4069,7 +4070,7 @@ model {
|
|
|
4069
4070
|
features.inlines.preset -[uses]-> model_.model_ '3 imports'
|
|
4070
4071
|
features.inlines.reference -[uses]-> features.components '5 imports, 1 type-only'
|
|
4071
4072
|
features.inlines.reference -[uses]-> features.ext-loader '2 imports'
|
|
4072
|
-
features.inlines.reference -[uses]-> features.shared '
|
|
4073
|
+
features.inlines.reference -[uses]-> features.shared '24 imports, 8 type-only'
|
|
4073
4074
|
features.inlines.reference -[uses]-> framework.global_ '3 imports'
|
|
4074
4075
|
features.inlines.reference -[uses]-> framework.std '13 imports, 5 type-only'
|
|
4075
4076
|
features.inlines.reference -[uses]-> framework.store '2 imports, 2 type-only'
|
|
@@ -4792,9 +4793,9 @@ model {
|
|
|
4792
4793
|
features.blocks.database.properties -[imports]-> framework.store.src '5 imports, 1 type-only'
|
|
4793
4794
|
features.blocks.database.service -[imports]-> features.data-view.src '1 import, 1 type-only'
|
|
4794
4795
|
features.blocks.database.service -[imports]-> features.shared.services '1 import'
|
|
4795
|
-
features.blocks.database.service -[imports]-> framework.global_.di '
|
|
4796
|
+
features.blocks.database.service -[imports]-> framework.global_.di '4 imports'
|
|
4796
4797
|
features.blocks.database.service -[imports]-> framework.std.src '1 import, 1 type-only'
|
|
4797
|
-
features.blocks.database.service -[imports]-> framework.store.src '
|
|
4798
|
+
features.blocks.database.service -[imports]-> framework.store.src '3 imports, 3 type-only'
|
|
4798
4799
|
features.blocks.database.service -[imports]-> model_.model_.src '3 imports, 2 type-only'
|
|
4799
4800
|
features.blocks.database.src -[imports]-> features.blocks.database.adapters '1 import'
|
|
4800
4801
|
features.blocks.database.src -[imports]-> features.blocks.database.components '4 imports'
|
|
@@ -4829,6 +4830,7 @@ model {
|
|
|
4829
4830
|
features.blocks.database.src -[imports]-> framework.std.src '7 imports, 3 type-only'
|
|
4830
4831
|
features.blocks.database.src -[imports]-> framework.store.src '7 imports, 4 type-only'
|
|
4831
4832
|
features.blocks.database.src -[imports]-> model_.model_.src '9 imports, 7 type-only'
|
|
4833
|
+
features.blocks.database.utils -[imports]-> features.blocks.database.service '1 import, 1 type-only'
|
|
4832
4834
|
features.blocks.database.utils -[imports]-> features.shared.types '1 import, 1 type-only'
|
|
4833
4835
|
features.blocks.database.utils -[imports]-> features.shared.utils '1 import'
|
|
4834
4836
|
features.blocks.database.utils -[imports]-> framework.store.src '2 imports, 2 type-only'
|
|
@@ -4874,11 +4876,12 @@ model {
|
|
|
4874
4876
|
features.blocks.embed-doc.common -[imports]-> features.blocks.embed.src '1 import'
|
|
4875
4877
|
features.blocks.embed-doc.common -[imports]-> features.ext-loader.src '1 import'
|
|
4876
4878
|
features.blocks.embed-doc.common -[imports]-> features.shared.consts '1 import'
|
|
4879
|
+
features.blocks.embed-doc.common -[imports]-> features.shared.services '1 import'
|
|
4877
4880
|
features.blocks.embed-doc.common -[imports]-> features.shared.utils '1 import'
|
|
4878
|
-
features.blocks.embed-doc.common -[imports]-> framework.std.src '1
|
|
4881
|
+
features.blocks.embed-doc.common -[imports]-> framework.std.src '2 imports, 1 type-only'
|
|
4879
4882
|
features.blocks.embed-doc.common -[imports]-> framework.store.src '2 imports, 2 type-only'
|
|
4880
|
-
features.blocks.embed-doc.common -[imports]-> model_.model_.src '1
|
|
4881
|
-
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> features.blocks.embed-doc.common '
|
|
4883
|
+
features.blocks.embed-doc.common -[imports]-> model_.model_.src '2 imports, 1 type-only'
|
|
4884
|
+
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> features.blocks.embed-doc.common '3 imports'
|
|
4882
4885
|
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> features.blocks.embed-doc.embed-synced-doc-block '2 imports'
|
|
4883
4886
|
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> features.blocks.embed-doc.src '3 imports'
|
|
4884
4887
|
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> features.blocks.embed.src '4 imports'
|
|
@@ -4890,7 +4893,7 @@ model {
|
|
|
4890
4893
|
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> features.inlines.reference.src '1 import'
|
|
4891
4894
|
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> features.rich-text.src '1 import'
|
|
4892
4895
|
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> features.shared.adapters '3 imports'
|
|
4893
|
-
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> features.shared.consts '
|
|
4896
|
+
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> features.shared.consts '5 imports'
|
|
4894
4897
|
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> features.shared.services '3 imports'
|
|
4895
4898
|
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> features.shared.theme '1 import'
|
|
4896
4899
|
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> features.shared.utils '4 imports'
|
|
@@ -4899,7 +4902,7 @@ model {
|
|
|
4899
4902
|
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> framework.std.src '5 imports, 2 type-only'
|
|
4900
4903
|
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> framework.store.src '8 imports, 5 type-only'
|
|
4901
4904
|
features.blocks.embed-doc.embed-linked-doc-block -[imports]-> model_.model_.src '11 imports, 2 type-only'
|
|
4902
|
-
features.blocks.embed-doc.embed-synced-doc-block -[imports]-> features.blocks.embed-doc.common '
|
|
4905
|
+
features.blocks.embed-doc.embed-synced-doc-block -[imports]-> features.blocks.embed-doc.common '3 imports'
|
|
4903
4906
|
features.blocks.embed-doc.embed-synced-doc-block -[imports]-> features.blocks.embed-doc.src '4 imports'
|
|
4904
4907
|
features.blocks.embed-doc.embed-synced-doc-block -[imports]-> features.blocks.embed.src '5 imports'
|
|
4905
4908
|
features.blocks.embed-doc.embed-synced-doc-block -[imports]-> features.blocks.surface.src '3 imports'
|
|
@@ -4942,7 +4945,7 @@ model {
|
|
|
4942
4945
|
features.blocks.embed.common -[imports]-> features.components.caption '1 import'
|
|
4943
4946
|
features.blocks.embed.common -[imports]-> features.components.icons_ '1 import'
|
|
4944
4947
|
features.blocks.embed.common -[imports]-> features.shared.adapters '4 imports, 3 type-only'
|
|
4945
|
-
features.blocks.embed.common -[imports]-> features.shared.consts '
|
|
4948
|
+
features.blocks.embed.common -[imports]-> features.shared.consts '3 imports'
|
|
4946
4949
|
features.blocks.embed.common -[imports]-> features.shared.services '3 imports'
|
|
4947
4950
|
features.blocks.embed.common -[imports]-> features.shared.theme '1 import'
|
|
4948
4951
|
features.blocks.embed.common -[imports]-> features.shared.utils '4 imports'
|
|
@@ -5801,6 +5804,7 @@ model {
|
|
|
5801
5804
|
features.components.view-dropdown-menu -[imports]-> framework.std.src '1 import'
|
|
5802
5805
|
features.data-view.core -[imports]-> features.components.color-picker '2 imports'
|
|
5803
5806
|
features.data-view.core -[imports]-> features.components.context-menu '17 imports, 3 type-only'
|
|
5807
|
+
features.data-view.core -[imports]-> features.components.icons_ '1 import'
|
|
5804
5808
|
features.data-view.core -[imports]-> features.components.src '1 import'
|
|
5805
5809
|
features.data-view.core -[imports]-> features.data-view.src '7 imports'
|
|
5806
5810
|
features.data-view.core -[imports]-> features.data-view.view-presets '5 imports, 3 type-only'
|
|
@@ -5962,6 +5966,7 @@ model {
|
|
|
5962
5966
|
features.fragments.doc-title.src -[imports]-> framework.store.src '1 import, 1 type-only'
|
|
5963
5967
|
features.fragments.doc-title.src -[imports]-> model_.model_.src '1 import'
|
|
5964
5968
|
features.fragments.doc-title.title-band -[imports]-> features.blocks.surface.src '1 import'
|
|
5969
|
+
features.fragments.doc-title.title-band -[imports]-> features.components.icons_ '1 import'
|
|
5965
5970
|
features.fragments.doc-title.title-band -[imports]-> features.data-view.property-presets '1 import'
|
|
5966
5971
|
features.fragments.doc-title.title-band -[imports]-> features.data-view.src '2 imports'
|
|
5967
5972
|
features.fragments.doc-title.title-band -[imports]-> features.fragments.doc-title.src '1 import'
|
|
@@ -6939,7 +6944,7 @@ model {
|
|
|
6939
6944
|
features.inlines.reference.reference-node -[imports]-> features.components.src '1 import'
|
|
6940
6945
|
features.inlines.reference.reference-node -[imports]-> features.components.toolbar '1 import, 1 type-only'
|
|
6941
6946
|
features.inlines.reference.reference-node -[imports]-> features.inlines.reference.src '1 import'
|
|
6942
|
-
features.inlines.reference.reference-node -[imports]-> features.shared.consts '
|
|
6947
|
+
features.inlines.reference.reference-node -[imports]-> features.shared.consts '3 imports'
|
|
6943
6948
|
features.inlines.reference.reference-node -[imports]-> features.shared.services '5 imports, 2 type-only'
|
|
6944
6949
|
features.inlines.reference.reference-node -[imports]-> features.shared.styles '2 imports'
|
|
6945
6950
|
features.inlines.reference.reference-node -[imports]-> features.shared.types '3 imports, 3 type-only'
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "blocksuite"
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "blocksuite"
|
|
3
|
+
}
|
|
@@ -2,6 +2,7 @@ import { type AssetRef } from '../affine-shared/services/index.js';
|
|
|
2
2
|
import type { IVec } from '../global/gfx/index.js';
|
|
3
3
|
import type { BlockStdScope } from '../std/index.js';
|
|
4
4
|
import type { BlockModel } from '../store/index.js';
|
|
5
|
+
import { type AttachmentBlockSource } from './utils.js';
|
|
5
6
|
/**
|
|
6
7
|
* Adds one attachment card per ref next to `targetModel`, as one undo step.
|
|
7
8
|
* Nothing is written on a read-only document.
|
|
@@ -22,3 +23,10 @@ export declare function addAttachmentsFromAssets(std: BlockStdScope, assets: rea
|
|
|
22
23
|
export declare function pickAndAddSiblingAttachmentBlocks(std: BlockStdScope, targetModel: BlockModel): Promise<string[]>;
|
|
23
24
|
/** The canvas's file button: the host's asset dialog, or the file chooser. */
|
|
24
25
|
export declare function pickAndAddAttachments(std: BlockStdScope): Promise<string[]>;
|
|
26
|
+
/**
|
|
27
|
+
* What the attachment toolbar's "Replace" puts in the card: the host's asset
|
|
28
|
+
* dialog when there is one (`kind: 'file'`, `mode: 'replace'`, first ref
|
|
29
|
+
* used, by reference), the system file chooser otherwise (the file goes up
|
|
30
|
+
* through the blob source, as before). `null` when cancelled.
|
|
31
|
+
*/
|
|
32
|
+
export declare function pickAttachmentSource(std: BlockStdScope): Promise<AttachmentBlockSource | null>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AssetPickerProvider, } from '../affine-shared/services/index.js';
|
|
2
2
|
import { openSingleFileWith } from '../affine-shared/utils/index.js';
|
|
3
|
-
import { addAttachments, addSiblingAttachmentBlocks, placeAttachmentsOnCanvas, } from './utils.js';
|
|
3
|
+
import { addAttachments, addSiblingAttachmentBlocks, getFileType, placeAttachmentsOnCanvas, } from './utils.js';
|
|
4
4
|
/**
|
|
5
5
|
* Attachments from the host's asset library (`AssetPickerProvider`, labre
|
|
6
6
|
* P4): the card references a blob the host already stores, by its
|
|
@@ -85,3 +85,27 @@ export async function pickAndAddAttachments(std) {
|
|
|
85
85
|
return [];
|
|
86
86
|
return addAttachments(std, [file]);
|
|
87
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* What the attachment toolbar's "Replace" puts in the card: the host's asset
|
|
90
|
+
* dialog when there is one (`kind: 'file'`, `mode: 'replace'`, first ref
|
|
91
|
+
* used, by reference), the system file chooser otherwise (the file goes up
|
|
92
|
+
* through the blob source, as before). `null` when cancelled.
|
|
93
|
+
*/
|
|
94
|
+
export async function pickAttachmentSource(std) {
|
|
95
|
+
const picker = std.getOptional(AssetPickerProvider);
|
|
96
|
+
if (picker) {
|
|
97
|
+
const [asset] = (await picker.pick({
|
|
98
|
+
kind: 'file',
|
|
99
|
+
mode: 'replace',
|
|
100
|
+
multiple: false,
|
|
101
|
+
docId: std.store.id,
|
|
102
|
+
})) ?? [];
|
|
103
|
+
return asset ? (attachmentPropsFrom([asset])[0] ?? null) : null;
|
|
104
|
+
}
|
|
105
|
+
const file = await openSingleFileWith();
|
|
106
|
+
if (!file)
|
|
107
|
+
return null;
|
|
108
|
+
const sourceId = await std.store.blobSync.set(file);
|
|
109
|
+
const type = await getFileType(file);
|
|
110
|
+
return { sourceId, name: file.name, type, size: file.size };
|
|
111
|
+
}
|
|
@@ -39,7 +39,7 @@ import { ResourceController, } from '../affine-components/resource/index.js';
|
|
|
39
39
|
import { toast } from '../affine-components/toast/index.js';
|
|
40
40
|
import { AttachmentBlockStyles, } from '../affine-model/index.js';
|
|
41
41
|
import { BlockCommentManager, CitationProvider, DocModeProvider, FileSizeLimitProvider, TelemetryProvider, TOAST_COPIED_TO_CLIPBOARD, translateKey, } from '../affine-shared/services/index.js';
|
|
42
|
-
import { formatSize
|
|
42
|
+
import { formatSize } from '../affine-shared/utils/index.js';
|
|
43
43
|
import { AttachmentIcon, ResetIcon, UpgradeIcon, WarningIcon, } from '@blocksuite/icons/lit';
|
|
44
44
|
import { BlockSelection } from '../std/index.js';
|
|
45
45
|
import { nanoid, Slice } from '../store/index.js';
|
|
@@ -51,9 +51,10 @@ import { guard } from 'lit/directives/guard.js';
|
|
|
51
51
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
52
52
|
import { when } from 'lit/directives/when.js';
|
|
53
53
|
import { filter } from 'rxjs/operators';
|
|
54
|
+
import { pickAttachmentSource } from './asset-picker.js';
|
|
54
55
|
import { AttachmentEmbedProvider } from './embed.js';
|
|
55
56
|
import { styles } from './styles.js';
|
|
56
|
-
import { downloadAttachmentBlob,
|
|
57
|
+
import { downloadAttachmentBlob, refreshData } from './utils.js';
|
|
57
58
|
import { ATTACHMENT_BUTTON_RELOAD, ATTACHMENT_BUTTON_RETRY, ATTACHMENT_BUTTON_UPGRADE, } from './translations.js';
|
|
58
59
|
let AttachmentBlockComponent = (() => {
|
|
59
60
|
let _classDecorators = [Peekable({
|
|
@@ -121,12 +122,13 @@ let AttachmentBlockComponent = (() => {
|
|
|
121
122
|
const state = this.resourceController.state$.peek();
|
|
122
123
|
if (state.uploading)
|
|
123
124
|
return;
|
|
124
|
-
const
|
|
125
|
-
|
|
125
|
+
const source = await pickAttachmentSource(this.std);
|
|
126
|
+
// The dialog is async: the card may be gone, or the page read-only, by now.
|
|
127
|
+
if (!source || this.std.store.readonly)
|
|
126
128
|
return;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const { name, size } =
|
|
129
|
+
if (!this.std.store.getBlock(this.blockId))
|
|
130
|
+
return;
|
|
131
|
+
const { name, size, type, sourceId } = source;
|
|
130
132
|
let embed = this.model.props.embed$.value ?? false;
|
|
131
133
|
this.std.store.captureSync();
|
|
132
134
|
this.std.store.transact(() => {
|
|
@@ -27,9 +27,9 @@ import { databaseBlockStyles, databaseContentStyles, databaseHeaderBarStyles, da
|
|
|
27
27
|
import { BlockRenderer } from './detail-panel/block-renderer.js';
|
|
28
28
|
import { NoteRenderer } from './detail-panel/note-renderer.js';
|
|
29
29
|
import { DatabaseSelection } from './selection.js';
|
|
30
|
-
import { databaseOpenRowRequest, DatabaseDataSourceProvider, DatabaseNewRowMenuProvider, DatabaseOpenRowProvider, openDatabasePropertiesPanel, rowOpenedParams, } from './service/index.js';
|
|
30
|
+
import { databaseOpenRowRequest, DatabaseDataSourceProvider, DatabaseInitialViewProvider, DatabaseNewRowMenuProvider, DatabaseOpenRowProvider, openDatabasePropertiesPanel, rowOpenedParams, } from './service/index.js';
|
|
31
31
|
import { DATABASE_NEW_RECORD_MORE, DATABASE_SOURCE_MISSING, DATABASE_SOURCE_MISSING_HINT, } from './translations.js';
|
|
32
|
-
import { currentViewStorage } from './utils/current-view.js';
|
|
32
|
+
import { currentViewStorage, initialViewId } from './utils/current-view.js';
|
|
33
33
|
import { getSingleDocIdFromText } from './utils/title-doc.js';
|
|
34
34
|
import { DatabaseViewCreationIdentifier } from './view-creation.js';
|
|
35
35
|
export class DatabaseBlockComponent extends CaptionedBlockComponent {
|
|
@@ -311,10 +311,9 @@ export class DatabaseBlockComponent extends CaptionedBlockComponent {
|
|
|
311
311
|
const dataSource = provider && this.model.props.externalSourceId
|
|
312
312
|
? provider.createDataSource(this.model, initFn)
|
|
313
313
|
: new DatabaseBlockDataSource(this.model, initFn);
|
|
314
|
-
const id =
|
|
315
|
-
if (id
|
|
314
|
+
const id = initialViewId(this.model.id, viewId => dataSource.viewManager.viewGet(viewId) != null, this.std.getOptional(DatabaseInitialViewProvider));
|
|
315
|
+
if (id)
|
|
316
316
|
dataSource.viewManager.setCurrentView(id);
|
|
317
|
-
}
|
|
318
317
|
return dataSource;
|
|
319
318
|
}
|
|
320
319
|
get dataSource() {
|
|
@@ -14,6 +14,7 @@ export interface DatabaseDataSourceProvider {
|
|
|
14
14
|
createDataSource(model: DatabaseBlockModel, init?: (ds: DataSourceBase) => void): DataSourceBase;
|
|
15
15
|
}
|
|
16
16
|
export declare const DatabaseDataSourceProvider: import("../../global/di/types.js").ServiceIdentifier<DatabaseDataSourceProvider> & (<U extends DatabaseDataSourceProvider = DatabaseDataSourceProvider>(variant: import("../../global/di/types.js").ServiceVariant) => import("../../global/di/types.js").ServiceIdentifier<U>);
|
|
17
|
+
export * from './initial-view.js';
|
|
17
18
|
export * from './open-row.js';
|
|
18
19
|
export * from './properties-panel.js';
|
|
19
20
|
export * from './new-row-menu.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createIdentifier } from '../../global/di/index.js';
|
|
2
2
|
export const DatabaseBlockConfigService = createIdentifier('AffineDatabaseBlockConfigService');
|
|
3
3
|
export const DatabaseDataSourceProvider = createIdentifier('affine:database-data-source-provider');
|
|
4
|
+
export * from './initial-view.js';
|
|
4
5
|
export * from './open-row.js';
|
|
5
6
|
export * from './properties-panel.js';
|
|
6
7
|
export * from './new-row-menu.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ExtensionType } from '../../store/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Which `affine:database` block asks for the view it opens on. Only widens:
|
|
4
|
+
* a new field is optional.
|
|
5
|
+
*/
|
|
6
|
+
export interface DatabaseInitialViewRequest {
|
|
7
|
+
blockId: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The view a database opens on, chosen by the host (labre: a base's page
|
|
11
|
+
* opened from one of its views in the sidebar, `/base/:id?view=…`). Asked
|
|
12
|
+
* once, when the block builds its data source. An id the block does not
|
|
13
|
+
* have, or `undefined`, falls back to the view this tab last showed for the
|
|
14
|
+
* block (`currentViewStorage`), then to the first view.
|
|
15
|
+
*
|
|
16
|
+
* Nothing is written: the current view is a local signal of the view
|
|
17
|
+
* manager, never a stored prop, so opening on a view leaves the document
|
|
18
|
+
* untouched.
|
|
19
|
+
*/
|
|
20
|
+
export interface DatabaseInitialViewService {
|
|
21
|
+
initialView(request: DatabaseInitialViewRequest): string | undefined;
|
|
22
|
+
}
|
|
23
|
+
export declare const DatabaseInitialViewProvider: import("../../global/di/types.js").ServiceIdentifier<DatabaseInitialViewService> & (<U extends DatabaseInitialViewService = DatabaseInitialViewService>(variant: import("../../global/di/types.js").ServiceVariant) => import("../../global/di/types.js").ServiceIdentifier<U>);
|
|
24
|
+
/**
|
|
25
|
+
* Host seam: the view a database opens on.
|
|
26
|
+
*
|
|
27
|
+
* Absent or `null`, a database opens on the view this tab last showed for
|
|
28
|
+
* it, else its first view, as in 0.59.
|
|
29
|
+
*
|
|
30
|
+
* `di.override`, so a later registration wins and registering twice never
|
|
31
|
+
* throws at boot.
|
|
32
|
+
*/
|
|
33
|
+
export declare function DatabaseInitialViewExtension(service: DatabaseInitialViewService | null): ExtensionType;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createIdentifier } from '../../global/di/index.js';
|
|
2
|
+
export const DatabaseInitialViewProvider = createIdentifier('LabreDatabaseInitialView');
|
|
3
|
+
/**
|
|
4
|
+
* Host seam: the view a database opens on.
|
|
5
|
+
*
|
|
6
|
+
* Absent or `null`, a database opens on the view this tab last showed for
|
|
7
|
+
* it, else its first view, as in 0.59.
|
|
8
|
+
*
|
|
9
|
+
* `di.override`, so a later registration wins and registering twice never
|
|
10
|
+
* throws at boot.
|
|
11
|
+
*/
|
|
12
|
+
export function DatabaseInitialViewExtension(service) {
|
|
13
|
+
return {
|
|
14
|
+
setup: di => {
|
|
15
|
+
// `null` rides through on purpose: `getOptional` then reports no host
|
|
16
|
+
// choice and the block keeps its own.
|
|
17
|
+
di.override(DatabaseInitialViewProvider, () => service);
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
import type { DatabaseInitialViewService } from '../service/initial-view.js';
|
|
1
2
|
export declare const currentViewStorage: {
|
|
2
3
|
getCurrentView: (blockId: string) => string | undefined;
|
|
3
4
|
setCurrentView: (blockId: string, viewId: string) => void;
|
|
4
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* The view a database opens on: the host's choice when the block has it
|
|
8
|
+
* (`DatabaseInitialViewProvider`), else the one this tab last showed, else
|
|
9
|
+
* `undefined` (the view manager's first view). Reads only.
|
|
10
|
+
*/
|
|
11
|
+
export declare function initialViewId(blockId: string, exists: (viewId: string) => boolean, host?: DatabaseInitialViewService | null): string | undefined;
|
|
@@ -45,3 +45,17 @@ const createCurrentViewStorage = () => {
|
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
export const currentViewStorage = createCurrentViewStorage();
|
|
48
|
+
/**
|
|
49
|
+
* The view a database opens on: the host's choice when the block has it
|
|
50
|
+
* (`DatabaseInitialViewProvider`), else the one this tab last showed, else
|
|
51
|
+
* `undefined` (the view manager's first view). Reads only.
|
|
52
|
+
*/
|
|
53
|
+
export function initialViewId(blockId, exists, host) {
|
|
54
|
+
const asked = host?.initialView({ blockId });
|
|
55
|
+
if (asked && exists(asked))
|
|
56
|
+
return asked;
|
|
57
|
+
const stored = currentViewStorage.getCurrentView(blockId);
|
|
58
|
+
if (stored && exists(stored))
|
|
59
|
+
return stored;
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getSurfaceBlock } from '../../affine-block-surface/index.js';
|
|
2
2
|
import { ListBlockModel, NoteBlockModel, NoteDisplayMode, ParagraphBlockModel, } from '../../affine-model/index.js';
|
|
3
|
+
import { LINKED_DOC_NOTE_STYLE } from '../../affine-shared/consts/index.js';
|
|
3
4
|
import { CHROME_UNTITLED, NotificationProvider, TOAST_LINKED_DOC_CREATED, TOOLBAR_CREATE_LINKED_DOC, translateKey, } from '../../affine-shared/services/index.js';
|
|
4
5
|
import { matchModels } from '../../affine-shared/utils/index.js';
|
|
5
6
|
import { Slice, Text, } from '../../store/index.js';
|
|
@@ -125,6 +126,7 @@ export async function convertSelectedBlocksToLinkedDoc(std, doc, selectedModels,
|
|
|
125
126
|
{
|
|
126
127
|
flavour: 'affine:embed-linked-doc',
|
|
127
128
|
pageId: linkedDoc.id,
|
|
129
|
+
style: LINKED_DOC_NOTE_STYLE,
|
|
128
130
|
},
|
|
129
131
|
], 'before');
|
|
130
132
|
// delete selected elements
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReferenceParams } from '../../affine-model/index.js';
|
|
2
|
+
import type { BlockStdScope } from '../../std/index.js';
|
|
3
|
+
import type { TemplateResult } from 'lit';
|
|
4
|
+
type CardStd = Pick<BlockStdScope, 'get' | 'getOptional'>;
|
|
5
|
+
/**
|
|
6
|
+
* Whether a card of page `pageId` held by document `docId` is the child's own
|
|
7
|
+
* card rather than a reference (labre ADR-0045, amended 2026-10-27): the host
|
|
8
|
+
* lists the document's children through `TitleBandService.children$`. The
|
|
9
|
+
* library never computes a parent or a child. Read inside a `computed`, so a
|
|
10
|
+
* move in the host's tree redraws the card. Without the seam, or without
|
|
11
|
+
* `children$`, every card is a reference, as in 0.59.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isChildCard(std: Pick<CardStd, 'getOptional'>, docId: string, pageId: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The icon of a card (`embed-linked-doc`, `embed-synced-doc`): a child's own
|
|
16
|
+
* card shows the plain page or canvas icon; any other card, like an inline
|
|
17
|
+
* `@` reference, keeps the linked icon with its arrow (product owner,
|
|
18
|
+
* recette 3 P2-7c). An alias or a block link keeps its own icon.
|
|
19
|
+
*/
|
|
20
|
+
export declare function cardIcon(std: CardStd, docId: string, info: {
|
|
21
|
+
pageId: string;
|
|
22
|
+
params?: ReferenceParams;
|
|
23
|
+
title?: string;
|
|
24
|
+
}): TemplateResult;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DocDisplayMetaProvider, TitleBandProvider, } from '../../affine-shared/services/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Whether a card of page `pageId` held by document `docId` is the child's own
|
|
4
|
+
* card rather than a reference (labre ADR-0045, amended 2026-10-27): the host
|
|
5
|
+
* lists the document's children through `TitleBandService.children$`. The
|
|
6
|
+
* library never computes a parent or a child. Read inside a `computed`, so a
|
|
7
|
+
* move in the host's tree redraws the card. Without the seam, or without
|
|
8
|
+
* `children$`, every card is a reference, as in 0.59.
|
|
9
|
+
*/
|
|
10
|
+
export function isChildCard(std, docId, pageId) {
|
|
11
|
+
const children$ = std.getOptional(TitleBandProvider)?.children$?.(docId);
|
|
12
|
+
return children$?.value.includes(pageId) ?? false;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The icon of a card (`embed-linked-doc`, `embed-synced-doc`): a child's own
|
|
16
|
+
* card shows the plain page or canvas icon; any other card, like an inline
|
|
17
|
+
* `@` reference, keeps the linked icon with its arrow (product owner,
|
|
18
|
+
* recette 3 P2-7c). An alias or a block link keeps its own icon.
|
|
19
|
+
*/
|
|
20
|
+
export function cardIcon(std, docId, info) {
|
|
21
|
+
const { pageId, params, title } = info;
|
|
22
|
+
return std.get(DocDisplayMetaProvider).icon(pageId, {
|
|
23
|
+
params,
|
|
24
|
+
title,
|
|
25
|
+
referenced: !isChildCard(std, docId, pageId),
|
|
26
|
+
}).value;
|
|
27
|
+
}
|
package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/commands/insert-embed-linked-doc.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { insertEmbedCard } from '../../../affine-block-embed/index.js';
|
|
2
|
+
import { LINKED_DOC_NOTE_STYLE } from '../../../affine-shared/consts/index.js';
|
|
2
3
|
export const insertEmbedLinkedDocCommand = (ctx, next) => {
|
|
3
4
|
const { docId, params, std } = ctx;
|
|
4
5
|
const flavour = 'affine:embed-linked-doc';
|
|
5
6
|
const targetStyle = 'vertical';
|
|
6
|
-
|
|
7
|
+
// In a note the card is a line; on the canvas `targetStyle` wins.
|
|
8
|
+
const props = {
|
|
9
|
+
pageId: docId,
|
|
10
|
+
style: LINKED_DOC_NOTE_STYLE,
|
|
11
|
+
};
|
|
7
12
|
if (params)
|
|
8
13
|
props.params = params;
|
|
9
14
|
const blockId = insertEmbedCard(std, { flavour, targetStyle, props });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { insertContent } from '../../../affine-rich-text/index.js';
|
|
2
|
-
import { REFERENCE_NODE } from '../../../affine-shared/consts/index.js';
|
|
2
|
+
import { LINKED_DOC_NOTE_STYLE, REFERENCE_NODE, } from '../../../affine-shared/consts/index.js';
|
|
3
3
|
import { LinkedDocCreationProvider, TelemetryProvider, } from '../../../affine-shared/services/index.js';
|
|
4
4
|
import { createDefaultDoc, writeDefaultDocBlocks, } from '../../../affine-shared/utils/index.js';
|
|
5
5
|
const LINKED_DOC = 'affine:embed-linked-doc';
|
|
@@ -63,7 +63,7 @@ function insertCard(store, anchor, pageId) {
|
|
|
63
63
|
if (!parent || !store.schema.isValid(LINKED_DOC, parent.flavour)) {
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
66
|
-
const cardId = store.addBlock(LINKED_DOC, { pageId }, parent, parent.children.indexOf(anchor) + 1);
|
|
66
|
+
const cardId = store.addBlock(LINKED_DOC, { pageId, style: LINKED_DOC_NOTE_STYLE }, parent, parent.children.indexOf(anchor) + 1);
|
|
67
67
|
if (anchor.flavour === 'affine:paragraph' && anchor.text?.length === 0) {
|
|
68
68
|
store.deleteBlock(anchor);
|
|
69
69
|
}
|
|
@@ -54,6 +54,7 @@ import { when } from 'lit/directives/when.js';
|
|
|
54
54
|
import throttle from 'lodash-es/throttle.js';
|
|
55
55
|
import { filter } from 'rxjs/operators';
|
|
56
56
|
import * as Y from 'yjs';
|
|
57
|
+
import { cardIcon } from '../common/child-card.js';
|
|
57
58
|
import { isDocTrashed } from '../common/doc-trashed.js';
|
|
58
59
|
import { renderLinkedDocInCard } from '../common/render-linked-doc.js';
|
|
59
60
|
import { SyncedDocErrorIcon } from '../embed-synced-doc-block/styles.js';
|
|
@@ -371,12 +372,7 @@ let EmbedLinkedDocBlockComponent = (() => {
|
|
|
371
372
|
description: description$.value,
|
|
372
373
|
});
|
|
373
374
|
});
|
|
374
|
-
this.icon$ = computed(() =>
|
|
375
|
-
const { pageId, params, title } = this.referenceInfo$.value;
|
|
376
|
-
return this.std
|
|
377
|
-
.get(DocDisplayMetaProvider)
|
|
378
|
-
.icon(pageId, { params, title, referenced: true }).value;
|
|
379
|
-
});
|
|
375
|
+
this.icon$ = computed(() => cardIcon(this.std, this.store.id, this.referenceInfo$.value));
|
|
380
376
|
this.open = ({ openMode, event, } = {}) => {
|
|
381
377
|
this.std.getOptional(RefNodeSlotsProvider)?.docLinkClicked.next({
|
|
382
378
|
...this.referenceInfo$.peek(),
|
|
@@ -52,6 +52,7 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
52
52
|
import { guard } from 'lit/directives/guard.js';
|
|
53
53
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
54
54
|
import * as Y from 'yjs';
|
|
55
|
+
import { cardIcon } from '../common/child-card.js';
|
|
55
56
|
import { isDocTrashed } from '../common/doc-trashed.js';
|
|
56
57
|
import { EMBED_DOC_CARD_EMPTY_CONTENT } from '../translations.js';
|
|
57
58
|
import { blockStyles } from './styles.js';
|
|
@@ -329,9 +330,7 @@ let EmbedSyncedDocBlockComponent = (() => {
|
|
|
329
330
|
};
|
|
330
331
|
this.icon$ = computed(() => {
|
|
331
332
|
const { pageId, params } = this.model.props;
|
|
332
|
-
return this.std
|
|
333
|
-
.get(DocDisplayMetaProvider)
|
|
334
|
-
.icon(pageId, { params, referenced: true }).value;
|
|
333
|
+
return cardIcon(this.std, this.store.id, { pageId, params });
|
|
335
334
|
});
|
|
336
335
|
this.open = (event) => {
|
|
337
336
|
const pageId = this.model.props.pageId;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EdgelessCRUDIdentifier } from '../../affine-block-surface/index.js';
|
|
2
|
-
import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, } from '../../affine-shared/consts/index.js';
|
|
2
|
+
import { EMBED_CARD_HEIGHT, EMBED_CARD_WIDTH, LINKED_DOC_NOTE_STYLE, } from '../../affine-shared/consts/index.js';
|
|
3
3
|
import { PageDropProvider, pageDropVerdict, TelemetryProvider, } from '../../affine-shared/services/index.js';
|
|
4
4
|
import { calcDropTarget, getClosestBlockComponentByPoint, getLastNoteBlock, isInsideEdgelessEditor, matchModels, } from '../../affine-shared/utils/index.js';
|
|
5
5
|
import { Bound, Point } from '../../global/gfx/index.js';
|
|
@@ -52,7 +52,7 @@ function insertBeside(store, pageId, line) {
|
|
|
52
52
|
if (!parent)
|
|
53
53
|
return null;
|
|
54
54
|
if (store.schema.safeValidate(LINKED_DOC, parent.flavour)) {
|
|
55
|
-
return (store.addSiblingBlocks(model, [{ flavour: LINKED_DOC, pageId }], placement)[0] ?? null);
|
|
55
|
+
return (store.addSiblingBlocks(model, [{ flavour: LINKED_DOC, pageId, style: LINKED_DOC_NOTE_STYLE }], placement)[0] ?? null);
|
|
56
56
|
}
|
|
57
57
|
// Out of a list item or a callout: the card goes after the container.
|
|
58
58
|
model = parent;
|
|
@@ -65,7 +65,7 @@ function insertAtEnd(store, pageId) {
|
|
|
65
65
|
if (!root)
|
|
66
66
|
return null;
|
|
67
67
|
const noteId = getLastNoteBlock(store)?.id ?? store.addBlock('affine:note', {}, root.id);
|
|
68
|
-
return store.addBlock(LINKED_DOC, { pageId }, noteId);
|
|
68
|
+
return store.addBlock(LINKED_DOC, { pageId, style: LINKED_DOC_NOTE_STYLE }, noteId);
|
|
69
69
|
}
|
|
70
70
|
function insertOnCanvas(std, pageId, point) {
|
|
71
71
|
const gfx = std.get(GfxControllerIdentifier);
|