BlockSuite API Documentation / @blocksuite/affine-inline-reference
@blocksuite/affine-inline-reference
Classes
AffineReference
Extends
ShadowlessElement<this> &DisposableClass<this>
Constructors
Other
_whenHover
_whenHover:
object
dispose()
dispose: () =>
void
Returns
void
setFloating()
setFloating: (
element?) =>void
Parameters
element?
Element
Returns
void
setReference()
setReference: (
element?) =>void
Parameters
element?
Element
Returns
void
styles
staticstyles:CSSResult
Overrides
WithDisposable(ShadowlessElement).styles
_icon
Get Signature
get _icon():
TemplateResult
Returns
TemplateResult
_title
Get Signature
get _title():
string|undefined
Returns
string | undefined
block
Get Signature
get block():
BlockComponent<BlockModel<object>,BlockService,string> |null
Returns
BlockComponent<BlockModel<object>, BlockService, string> | null
config
customContent
Get Signature
get customContent(): (
reference) =>TemplateResult|undefined
Returns
(reference) => TemplateResult | undefined
delta
doc
Get Signature
get doc():
Store
Returns
docTitle
Get Signature
get docTitle():
string
Returns
string
inlineEditor
Get Signature
get inlineEditor():
InlineEditor<AffineTextAttributes> |undefined
Returns
InlineEditor<AffineTextAttributes> | undefined
referenceInfo
Get Signature
get referenceInfo():
object
Returns
object
description?
optionaldescription:string
pageId
pageId:
string
params?
optionalparams:object
params.blockIds?
optionalparams.blockIds:string[]
params.commentId?
optionalparams.commentId:string
params.databaseId?
optionalparams.databaseId:string
params.databaseRowId?
optionalparams.databaseRowId:string
params.elementIds?
optionalparams.elementIds:string[]
params.mode?
optionalparams.mode:"edgeless"|"page"
params.xywh?
optionalparams.xywh:`[${number},${number},${number},${number}]`
title?
optionaltitle:string
refMeta
selected
selfInlineRange
Get Signature
get selfInlineRange():
InlineRange|null|undefined
Returns
InlineRange | null | undefined
std
connectedCallback()
connectedCallback():
void
Returns
void
Overrides
WithDisposable(ShadowlessElement).connectedCallback
open()
readonlyopen(event?):void
Parameters
event?
Partial<DocLinkClickedEvent>
Returns
void
referenceToNode()
referenceToNode():
boolean
Returns
boolean
attributes
controllers
dev-mode
lifecycle
properties
rendering
render()
render(): typeof
nothing|TemplateResult<1>
Invoked on each update to perform rendering tasks. This method may return any value renderable by lit-html's ChildPart - typically a TemplateResult. Setting properties inside this method will not trigger the element to update.
Returns
typeof nothing | TemplateResult<1>
Overrides
WithDisposable(ShadowlessElement).render
styles
updates
willUpdate()
willUpdate(
_changedProperties):void
Invoked before update() to compute values needed during the update.
Implement willUpdate to compute property values that depend on other properties and are used in the rest of the update process.
willUpdate(changedProperties) {
// only need to check changed properties for an expensive computation.
if (changedProperties.has('firstName') || changedProperties.has('lastName')) {
this.sha = computeSHA(`${this.firstName} ${this.lastName}`);
}
}
render() {
return html`SHA: ${this.sha}`;
}Parameters
_changedProperties
Map<PropertyKey, unknown>
Returns
void
Overrides
WithDisposable(ShadowlessElement).willUpdate
ReferenceNodeConfigProvider
Constructors
Constructor
new ReferenceNodeConfigProvider(
std):ReferenceNodeConfigProvider
Parameters
std
Returns
Properties
std
readonlystd:BlockStdScope
Accessors
customContent
Get Signature
get customContent(): (
reference) =>TemplateResult|undefined
Returns
(reference) => TemplateResult | undefined
doc
Get Signature
get doc():
Store
Returns
hidePopup
Get Signature
get hidePopup():
boolean
Returns
boolean
interactable
Get Signature
get interactable():
boolean
Returns
boolean
Methods
setCustomContent()
setCustomContent(
content):void
Parameters
content
(reference) => TemplateResult | undefined
Returns
void
setHidePopup()
setHidePopup(
hidePopup):void
Parameters
hidePopup
boolean
Returns
void
setInteractable()
setInteractable(
interactable):void
Parameters
interactable
boolean
Returns
void
ReferencePopup
Extends
ShadowlessElement<this> &DisposableClass<this>
Constructors
Other
styles
staticstyles:CSSResult
Overrides
SignalWatcher( WithDisposable(ShadowlessElement) ).styles
abortController
docTitle
inlineEditor
inlineRange
inputElement
overlayMask
popoverContainer
referenceInfo
saveButton
std
title$
connectedCallback()
connectedCallback():
void
Returns
void
Overrides
SignalWatcher( WithDisposable(ShadowlessElement) ).connectedCallback
attributes
controllers
dev-mode
lifecycle
properties
rendering
render()
render():
TemplateResult<1>
Invoked on each update to perform rendering tasks. This method may return any value renderable by lit-html's ChildPart - typically a TemplateResult. Setting properties inside this method will not trigger the element to update.
Returns
TemplateResult<1>
Overrides
SignalWatcher( WithDisposable(ShadowlessElement) ).render
styles
updates
firstUpdated()
firstUpdated():
void
Invoked when the element is first updated. Implement to perform one time work on the element after update.
firstUpdated() {
this.renderRoot.getElementById('my-text-area').focus();
}Setting properties inside this method will trigger the element to update again after this update cycle completes.
Returns
void
Overrides
SignalWatcher( WithDisposable(ShadowlessElement) ).firstUpdated
updated()
updated():
void
Invoked whenever the element is updated. Implement to perform post-updating tasks via DOM APIs, for example, focusing an element.
Setting properties inside this method will trigger the element to update again after this update cycle completes.
Returns
void
Overrides
SignalWatcher( WithDisposable(ShadowlessElement) ).updated
Interfaces
ReferenceNodeConfig
Properties
customContent()?
optionalcustomContent: (reference) =>TemplateResult
Parameters
reference
Returns
TemplateResult
hidePopup?
optionalhidePopup:boolean
interactable?
optionalinteractable:boolean
Type Aliases
DocLinkClickedEvent
DocLinkClickedEvent =
ReferenceInfo&object
Type Declaration
event?
optionalevent:MouseEvent
host
host:
EditorHost
openMode?
optionalopenMode:OpenDocMode
RefNodeSlots
RefNodeSlots =
object
Properties
docLinkClicked
docLinkClicked:
Subject<DocLinkClickedEvent>
Variables
referenceDeltaMarkdownAdapterMatch
constreferenceDeltaMarkdownAdapterMatch:ExtensionType&object
Type Declaration
identifier
identifier:
ServiceIdentifier<InlineDeltaToPlainTextAdapterMatcher>
referenceDeltaToHtmlAdapterMatcher
constreferenceDeltaToHtmlAdapterMatcher:ExtensionType&object
Type Declaration
identifier
identifier:
ServiceIdentifier<InlineDeltaToHtmlAdapterMatcher>
referenceDeltaToMarkdownAdapterMatcher
constreferenceDeltaToMarkdownAdapterMatcher:ExtensionType&object
Type Declaration
identifier
identifier:
ServiceIdentifier<InlineDeltaToMarkdownAdapterMatcher>
ReferenceInlineSpecExtension
constReferenceInlineSpecExtension:ExtensionType&object
Type Declaration
identifier
identifier:
ServiceIdentifier<InlineSpecs<AffineTextAttributes>>
ReferenceNodeConfigExtension
constReferenceNodeConfigExtension:ConfigFactory<ReferenceNodeConfig>
referenceNodeToolbar
constreferenceNodeToolbar:ExtensionType
RefNodeSlotsExtension
constRefNodeSlotsExtension:ExtensionType
RefNodeSlotsProvider
constRefNodeSlotsProvider:ServiceIdentifier<RefNodeSlots> & <U>(variant) =>ServiceIdentifier<U>
Functions
insertLinkedNode()
insertLinkedNode(
__namedParameters):void
Parameters
__namedParameters
docId
string
inlineEditor
AffineInlineEditor
Returns
void
toggleReferencePopup()
toggleReferencePopup(
std,docTitle,referenceInfo,inlineEditor,inlineRange,abortController):ReferencePopup
Parameters
std
docTitle
string
referenceInfo
description?
string
pageId
string
params?
{ blockIds?: string[]; commentId?: string; databaseId?: string; databaseRowId?: string; elementIds?: string[]; mode?: "edgeless" | "page"; xywh?: `[${number},${number},${number},${number}]`; }
params.blockIds?
string[]
params.commentId?
string
params.databaseId?
string
params.databaseRowId?
string
params.elementIds?
string[]
params.mode?
"edgeless" | "page"
params.xywh?
`[${number},${number},${number},${number}]`
title?
string
inlineEditor
InlineEditor<AffineTextAttributes>
inlineRange
InlineRange
abortController
AbortController